Skip to main content

Posts

Showing posts with the label iphone-sdk-4.0

Could not load nib in bundle on iPhone device

I'm trying to test an app I'm developing on my iPhone. To do that I changed the target from Simulator to Device on Xcode. The application is correctly uploaded to the device and it works, or better, the main view is shown but if I try to open a secondary view, application crash.

Create text Stroke for UILabel iphone

I was wondering how can I create text stroke for UILabel in iOS4 ? I need some suggestion . I want something like this : EDITED : UIFont *font = [UIFont fontWithName:@"Arial" size:222]; CGPoint point = CGPointMake(0,0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 0.7); CGContextSetRGBStrokeColor(context, 2, 2, 2, 1.0); CGContextSetTextDrawingMode(context, kCGTextFillStroke); CGContextSaveGState(context); // I change it to my outlet [label.text drawAtPoint:point withFont:font]; CGContextRestoreGState(context); Source: Tips4all

Exit application in iOS 4.0

Before iOS4.0 clicking the home button on iPhone exits the application, and Apple had in their guide that programmatically exiting the application was not accepted. now everything changed in iOS4.0, clicking the home button puts your app in a suspended mode (multitasking).. and I think there should be a clear way for the user to exit the app, like an exit button. is it now OK with apple? and how can it be done?

NSDateFormatter returning nil in OS 4.0

I had the following code working on on OS 3.x NSString *stringDate = @"2010-06-21T20:06:36+00:00"; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; NSDate *theDate = [dateFormatter dateFromString:stringDate]; NSLog(@"%@",[dateFormatter stringFromDate:theDate]); but now in the newest xcode 3.2.3 under the iOS4 simulator, the varialble theDate is nil. I have looked through the class reference and do not see anything deprecated or implemented differently for iOS4 with these specific methods. What did i leave out?

Issue with iphone sdk 4.2.1

Probably a silly question. When running my project on the Device in the debug mode I get a lot of warnings al having the following string: warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)/Symbols/System/Library/PrivateFrameworks/ I think its due to the space between "4.2.1" and "(8C148a)". How can i get rid of it? It must be a setting somewhere in Xcode. I dont have these warnings on the simulator. thanks in advance, Christian

Works fine for the first time, next time getting DB locked issue

Please find the below function.it works fine for the first time. I mean , when i add a text it works for the first time , then when i try to add a new text again , it give me like "DB is locked". I am not sure how it works for the first not again? Please let me know what is the problem in my code. //================================================================== - ( BOOL ) addNewSimpleTemplates:(NSString*)dbPath:(NSString*)title{ //================================================================== BOOL returnVal = NO; NSString *maxValuePosition; if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { NSString *selectSQL = [NSString stringWithFormat:@"select MAX(pr.position) FROM phrase_reference pr inner join storyboard_main_categories smc on smc.id = pr.main_category_id where smc.category_name = %@", @"'Simple Templates'"]; const char *sql = [selectSQL UTF8String]; sqlite3_stmt *selectStmt; if(sqlite

My first web-based iPhone application - how to do it right?

I've built my first web-based iPhone app and I have some performance issues that I needs to be resolved. I want to verify that I'm doing it right, so your feedback is really appreciated... :-) The application presenting data - images & text directly from my remote MySQL DB using PHP based web-services. I'm using the SDWebImage for lazy-downloading. Now, I wonder if I'm doing everything right or is there something needs to be modified for better performance - Each connection to the DB is handling via NSMutableURLRequest using POST method. It's running again if I receive time-out connection from the DB and displaying an alert-view if connection fails. There is only one PHP web-service for every operation - I mean - if, for instance, I'm running the remote getInfo.php script for fetching information from my DB to be presented on info-view-controller, there is only one copy of this script on my web-site, so everyone's ru

post and delete method for ios devices

Adding a playlist to youtube account POST /feeds/api/playlists/PLAYLIST_ID HTTP/1.1 Host: gdata.youtube.com Content-Type: application/atom+xml Content-Length: CONTENT_LENGTH Authorization: AuthSub token="AUTHORIZATION_TOKEN" GData-Version: 2 X-GData-Key: key=DEVELOPER_KEY <?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <id>VIDEO_ID</id> <yt:position>1</yt:position> </entry> delete playlist of youtube account DELETE /feeds/api/users/USERNAME/playlists/PLAYLIST_ID HTTP/1.1 Host: gdata.youtube.com Content-Type: application/atom+xml Authorization: AuthSub token="AUTHORIZATION_TOKEN" GData-Version: 2 X-GData-Key: key=DEVELOPER_KEY HOW DO I SEND THIS BOTH METHOD TO YOUTUBE SERVER IN IOS AND GET RESULT. ihave all require data (e.g. token and allthat) but idont know how to send this post and delete method

Alert password field that stores password into the keychain and checks it against original login view controller

This is what I would like to happen I have screwed this up 60 times over now. Ok, I have a login View Controller that handles the login using the username and password and a remember me switch. The login view controller verifies against an API, checks the credentials then proceeds. If the user has selected the remember me switch the password is stored. Next I have a separate deposit view controller. Once the user clicks the deposit button within this deposit controller it pops up an alert with a password field and once the password is entered it checks against the original login screen password to see if they match if they do. It pushes on another view controller and then life goes on. Otherwise if it doesnt match the stored pass and alert with and error is presented. This just doesnt seem that hard but I'm having the hardest time with it I hope I made myself clear and questions let me know. -Justin