Tag: objective c
Detecting the initial launch of an app using NSUserDefaults
In reference to the following question: iPhone: How do I detect when an app is launched for the first time? When I looked up NSUserDefaults apple reference, it said that registerDefaults does not store the data onto the disk. In the above question, the app registers the value firstLaunch to YES upon each launch. So […]
Facebook SSO and request iOS SDK
I am trying to post a wall message to the current user. Before I am doing the request I am validating the session and authorizing if it isn’t. I left out some of the declarations and the initializing of the variables since to clarify. The problem is that the code shown here is executed before […]
SpriteKit view throwing NSInvalidArgumentException
I have this code below that loads a scene in the viewDidLoad: method. SKView *spriteView = (SKView *) self.view; spriteView.showsDrawCount = YES; spriteView.showsNodeCount = YES; spriteView.showsFPS = YES; PFPiePlanesScene *scene = [PFPiePlanesScene sceneWithSize:self.view.frame.size]; scene.scaleMode = SKSceneScaleModeAspectFill; [spriteView presentScene:scene]; When I call anything on the spriteView, it crashes with this message: Terminating app due to uncaught […]
Sorting array based on date and time with two dictionary keys
I am trying to sort an array based on date and time , I can successfully sort the array based on date both time is coming as another value in dictionary. So date comes as a string in format “yyyy-MM-dd” and time comes in as a string in format “HH:mm” Time value comes in key […]
How to detect the playing state of the audio in UIWebView in iOS?
I have an UIWebView to load a html web link:http://m.y.qq.com in my iOS app. I don’t know how to detect the playing state of the audio in UIWebView. I just need to know whether the audio in UIWebView is playing or not in my iOS app, so that I can do something. I have searched […]
What's Wrong with my notification code?
Note: there is an update below. I’ve asked in the previous question about specifying a minute for an hourly repeat interval. However, I had two answers asking me to try the date component, and I did. Here it is: [[UIApplication sharedApplication] cancelAllLocalNotifications]; NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar] ; NSDateComponents *componentsForReferenceDate = [[NSDateComponents alloc] init]; [componentsForReferenceDate […]
How to show the specific image from PhotoLibrary?
Possible Duplicate: display image from URL retrieved from ALAsset in iPhone In my Application I need to get specific image from Photo Library, with use of didFinishPickingMediaWithInfo i am able to get the Imagename and ImagePath. I am storing Imagename, ImagePath in Database. But, how to show that specific image with use of the Imagename […]