{ Snipperize } /iphone
Snippets about iphone
Check the first launch of the application on iPhone
Really simple example how to check the first launch of the iPhone application written in Objective-C in XCode.
Objective-C / iphone, NSUserDefaults / by ThePeppersStudio (60 days, 7.54 hours ago)
Getting the iPhone User Name
You will need to do a little additional formatting of the NSString if you need to display the returned value, as the result replaces spaces and punctuation – "John’s iPhone" is returned as "John-s-iPhone". When I ran this on the simulator, the output I received was : john-3.local.
Objective-C / iphone, username, UIDevide, NSHost / by ThePeppersStudio (71 days, 14.75 hours ago)
Calling Code In A Different Controller With Objective-C
The NSNotificationCenter allows you to pass 1 object only, if your target method needs more arguments I suggest you pass an array and create and intermediate method to split the array and call the final method.
Objective-C / iphone, NSNotificationCenter / by ThePeppersStudio (71 days, 14.79 hours ago)
MediaPlayerController
initialize of MPMusicPlayerController
Objective-C / MPMusicPlayerController, iphone / by ThePeppersStudio (73 days, 9.85 hours ago)
Inserting A UITextField In A UIAlertView
This will be a simple tutorial showing you how to put a UITextField in a UIAlertView. This is simple and just a couple lines if code. You will learn CGAffineTransform and coding UITextField programmatically.
Objective-C / iphone, uitextfield, uialertview / by ThePeppersStudio (75 days, 3.34 hours ago)
How To detect an internet connection with the iPhone SDK
Download the reachability project from Apple Copy Reachability.h and Reachability.m to your project. Add the ‘SystemConfiguration’ framework to your project.
Objective-C / iphone, internet, reachability, SystemConfiguration / by ThePeppersStudio (75 days, 3.49 hours ago)
Translucent UIView
The most basic code is here: 最简单的就是显示一个什么也没有的view,如下 CGRect frame = [[UIScreen mainScreen] applicationFrame];//获取窗口大小 UIView *theView = [[UIView alloc] initWithFrame:frame];//实例一个UIView theView.backgroundColor = [UIColor blackColor];//设置其背景色为黑色 theView.alpha = 0.7;//设置其透明为0.7 然后想办法显示这个theView即可,比如 [[[UIApplication sharedApplication] keyWindow] addSubview:theView]
Objective-C / iphone, translucent, uiview / by ThePeppersStudio (75 days, 3.56 hours ago)
Code Snippet: Prevent The iPhone From Sleeping
The code below will prevent the iPhone from dimming its screen and ultimately going to sleep. Use it wisely as you don’t want your application becoming notorious for being a battery hog
Objective-C / iphone, sleep, idletimedisabled / by ThePeppersStudio (75 days, 3.59 hours ago)
OpenGL Screenshot
Take screenshot based on openGL on iphone.
Objective-C / iphone, screenshot, opengl / by ThePeppersStudio (75 days, 11.30 hours ago)
Retrieve info of the now playing media item in iPod
http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/iPodLibraryAccess_Guide/UsingMediaPlayback/UsingMediaPlayback.html#//apple_ref/doc/uid/TP40008765-CH100-SW1
Objective-C / iphone, ipod, media, info / by ThePeppersStudio (91 days, 13.58 hours ago)
- Home
- New Snippet
- Languages
-

