Skip to main content

Posts

Showing posts with the label ipad

UIBezierpath Shadow effect - iOs

Currently i am working on a paint app for iPhone and iPad.I am stuck with applying shadow effect to a paticular drawn path. I have use UIBezierpath to draw paths. Is there any way to apply shadow effect on UIBezierpath ? Thanks in Advance

add uiview at row selection

I want when tab on row a uiview containing two button appear at the center of the cell, so I did the following code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //how can I get the text of the cell here? UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; UIView *v = [[UIView alloc] init]; v.center = cell.center; UIButton*button1 =[[UIButton alloc] init]; button1.frame = CGRectMake(v.center.x - 5 , v.center.y , 5 , v.center.y + 4 ); button1.titleLabel.text = @"I'm label 1"; [v addSubview: button1]; UIButton*button2 =[[UIButton alloc] init]; button2.frame = CGRectMake(v.center.x - + 1 , v.center.y , 5 , v.center.y + 4 ); button2.titleLabel.text = @"I'm label 2"; [v addSubview: button2]; [cell addSubview:v]; /* <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"&

display UIMenuController on tab on cell

I have uitableview I want to display UIMenuController when I tab on cell such that if the content of the cell is text the menu show edit , send by mail else listen, send by mail adn hide it it if I leaved it or tab away of it, something like right click context menue any idea how to achieve that I did something like that - (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } - (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender { return (action == @selector(copy:)); } - (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender { if (action == @selector(copy:)) NSLog(@"in real life, we'd now copy somehow"); } but I need to customize the menu itself, and also implementing those thre methods doesn't show anything Best regards

Twitter like App rejected [closed]

I have an App which is rejected which behaves as the Twitter App on the ground that: 10.4 Apps that create alternate desktop/home screen environments or simulate multi-app widget experiences will be rejected with as description: We found your app includes a dashboard view which presents multiple windows at once, and is therefore not in compliance with the App Store Review Guidelines. The iOS Human Interface Guidelines allow for multiple screens in an app but access to these screens should always be sequential, never simultaneous. Please see the attached screenshot/s for more information. It would be appropriate to modify your app by determining an alternate way users can accomplish the same task in a single screen or a sequence of screens. The screenshot attached is seen below. Can anybody explain what exactly the reason is, looking at the Twitter App. Anybody with a similar experience and a possible solution apart from completely dashing t

Program a "No Photos In Albums&rdquo; screen

Is there a way to access this screen and edit it for your own program? Id want to change the "No Photos" text label. I already know how to edit the "albums" label, because I already built my UINavigation Controller. I guess mainly I want to know if this screen is usable or accessible to developers. EDIT: I don't want to access albums or the photo application from my program. I just want that image of the stacking photos in my application.

how can I remove the top border on UIToolBar

I have set my UIToolBar tint color to some value, and there is this border line that I see in which I want to remove: How do I remove this black border>

Woodwing: how to trigger the ModalViewController using custom web/html embedded content

Using Woodwing, we have a page that has custom html in it, using the custom web widget. That widget has an anchor tag, that when tapped, opens a page in safari. However, if we create the same page using the HTML widget, and a link overlay, that triggers a ModalView to display. I'm assuming this has something to do with WoodWing's (un)documented protocols for the anchor tags, that are captured by the WoodWing shell application and used to trigger the "ModalView" display. Since everything in Woodwing generates an XML that is parsed when the app is loaded, and I've done numerous applications, this seems reasonable. However, there is very little technical documentation. My question is: does anyone know any documentation on those protocols, or a way I can use custom-html to trigger the ModalView? I've tried replacing "http" with "ww" but no dice. It's possible it's javascript but I'm suspecting protocols...

Very slow query where table have many records

I' m using sqlite on iphone. I have table with 200 000 records. It' s size is small, only 2 MB. I' m doing standard select(3 collumns) with two simple condtions. I' m operating only on integer values( in return and condtion). All data are unique. I'm get usually only 10-50 records from database. In spite of that my query take 3 sec. It' s a lot of time. How i can improve this ? Edit: I can't load my table with other thread. NSString * query = [ NSString stringWithFormat:@"SELECT rRozklad.hour, rRozklad.minute, rRozklad.marks FROM rRozklad.idOkres=%i AND rRozklad.idPolaczeniaLinie=2 ORDER by rRozklad.hour, rRozklad.minute", okres]; NSLog(@"%@", query); const char * querystring = [ query UTF8String ]; sqlite3_stmt * statment; if(sqlite3_prepare_v2(database, querystring, -1, &statment, nil) == SQLITE_OK){ while(sqlite3_step(statment) == SQLITE_ROW){ NSMutableArray * temp = [[NSMutableArray alloc] initWithCapacity:2];

ibooks like carousel view

I want to create and app with carousel kind of view, with images in rows and columns, where number of columns are fixed, but number of rows varies. when user clicks on an image it opens up a detailed view. My initial approach is to used tableview, with one cell as a row, but here tricky part is calculating the column, which I am doing by tagging the views. Is my approach is right or is there is any other better way of doing it.

PhoneGap 1.4.1 Does Not Support iOS 3.x.x Anymore?

I have discovered after half a day of testing and frustration that the latest version of PhoneGap does not support iOS 3 devices anymore. The minimum version appears to be iOS 4. The simulator works fine, but when I try to load the out of the box PhoneGap app on a device I get a crash in AppDelegate.m CGRect viewBounds = [[UIScreen mainScreen] applicationFrame]; self.viewController = [[[MainViewController alloc] init] autorelease];// Crash on this line self.viewController.useSplashScreen = YES; The error is "Programme received signal: "EXC_BAD_ACCESS". iOS 4 devices work fine! The problem is easy to replicate - just setup a default PhoneGap 1.4.1 project and try to run it on an iOS 3 device. I am not too concerned as I think about 93% of iPad users use iOS 4 or 5 now, but it is a shame for the other 7%... Has anyone else had this problem and found a solution??? Cheers Nick.

Your Second iOS app Tutorial: How Many Sections Do They Want?

In Your Second iOS app, there is a portion that says the following: After you finish laying out the cells in the table, the detail scene should look similar to this: However, mine has Section-1, Section-2, Section-3 right above each section. I get the feeling that they want 1 section with three cells. Can you tell which?

Can"t show text in the UITableView

I have a view-based app that just does one thing : show a array in a TableView, but it doesn't work and I don't know why. Here's the code. .h @interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>{ NSArray *array; IBOutlet UITableView *table; } .m -(void)viewDidLoad{ [super viewDidLoad]; array = [array initWithObjects:@"iPad", @"iTV", nil]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [array count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseId

Resigning keyboard on touch

I've found some code that helps me resign the keyboard when a user touches the screen off of the UITextView element. Here's how it looks: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; if([self.speechBubble.speechText isFirstResponder] && [touch view] != self.speechBubble.speechText){ [self.speechBubble.speechText resignFirstResponder]; } [super touchesBegan:touches withEvent:event]; } This works perfectly so far, and will remove the keyboard if a user touches anywhere outside of the text view. However, it only works for the particular object that I'm running it for, so if I have two speechBubbles, it won't work. How can I change this so that ANY speechBubble will have the same effect? (I could move this code from my ViewController to my SpeechBubble class, but I'd have a little issue with how to use [touch view] to get touches outside of the speechBubble's view. ) Thanks

javascript onclick combining 2 events does not work on ios (iPhone, iPad)

I'm combining 2 javascripts in the onclick to do 2 things: 1. Stop an audio player 2. Load and iframe that has a video The following code works on all browsers but not iOS (iPhone, iPad) <a class="aboutclick" href="#" onclick="stop2();document.getElementById('frame').innerHTML='&lt;iframe src=&quot;paul-on-paul.html&quot; width=&quot;100%&quot; height=&quot;600&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot;&gt;&lt;/iframe&gt;'"><img src="assets/video-cold.jpg" alt="paul-gregory-video" width="161" height="81" border="0" /></a> The stop2() in the beginning of the onclick code is what turns off the music player. (it's Flash audio player so it doesn't apply to iOS). Tapping on the image does nothing on the iPad, iPhone with this code present. If I remove stop2(); from the onclick c

How to copy superclass properties to a subclass?

Let's say I have two Classes like so: Car { NSInteger wheels; NSInteger bumpers; } + (Car *)carWithData:(NSDictionary *)carData; Lexus : Car { GPS *navigation; } + (Lexus *)carWithData:(NSDictionary *)carData; carWithData: is a simple helper method that creates an instance of Car populated with variables from carData . Lexus' version would also set the navigation data. How would Lexus' carWithData look like without duplicating code from Car ?

Convert image data to binary text for vcard

I need to include an image in a vcard file. The image is supposed to be in binary format. I create the image data as follows: NSData *imageData = UIImageJPEGRepresentation([UIImage imageNamed:@"Pic1"], 1.0); I have unsuccessfully tried encoding using the following 2 methods: vcardString = [vcardString stringByAppendingFormat:@"PHOTO;ENCODING=b;TYPE=JPEG:%@\n", [imageData base64EncodedString]]; AND vcardString = [vcardString stringByAppendingFormat:@"PHOTO;ENCODING=b;TYPE=JPEG:%@\n", [imageData description]]; Any advice on how to get the image data properly encoded to binary would be appreciated. Thanks

iPhone EventKit Adding Event Custom Parameter

I am letting the user add events to the calendar in my app. My question is, can I add a custom field to the view when the user goes to add an event, an example, a 'Birthday' field with a switch or tick box (that I can deal with) so they suer can record custom stats. Is it possible to add this? Thanks.

Developing a new app; is maintaining iOS 4 compatibility still worth it? [closed]

I am currently in the starting phase of developing a new iOS app (for both iPhone and iPad) for a client. I'm really indecisive if I should still support iOS 4 or not. I tried to find some statistics about the adoption of iOS 5, one of the only fairly recent articles that I could find was this one. This article shows that 59,16% of all users of Bump for iPhone were using iOS 5 or later as of December 30th of last year. The (free) app will not be out for another 1.5 to 2 months, my personal guess is that the iOS 5 adoption percentage will be pretty large by then. I fully realize that there is no single answer to this question, but I would like to know what your experiences with backwards compatibility are and if you think it is worth the hassle. I would really like to use the new Storyboard functionality of Xcode and I would also really like to use ARC (although I understand that it is partially useable with iOS 4 too). The app will also use quite a bit of JSON and which is no

get ascii code from string in xcode for iphone app

hey just a couple quick noob questions about writing my first ios app. Ive been searching through the questions here but they all seem to address questions more advanced than mine so im getting confused. (1) All I want to do is turn a string into an array of integers representing the ASCII code. In other words, I want to convert: "This is some string. It has spaces, punctuation, AND capitals." into an array with 62 integers. (2) How do I get back from the NSArray to a string? (3) Also, are these expensive operations in terms of memory or computation time? It seems like it might be if we have to create a new variable at every iteration or something. I know how to declare all the variables and im assuming I run a loop through the length of the string and at each iteration I somehow get the character and convert it into a number with some call to a built in command. Thanks for any help you can offer or links to posts that might help!