¡@

Home 

2014/10/15 ¤U¤È 10:15:59

iphone Programming Glossary: with

How to check for an active Internet Connection on iPhone SDK?

http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk

to see if I have an Internet connection on the iPhone using the Cocoa Touch libraries. I came up with a way to do this using an NSURL . The way I did it seems a bit unreliable because even Google could.. class is one of the most used classes in projects so you might run into naming conflicts with other projects like ShareKit. If this happens you'll have to rename one of the pairs of Reachability.h..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to Allow scrolling of the contents of the.. I'd like to only write code for what needs it. Note the UIView or UIScrollView that I'm working with is brought up by a tabbar UITabBar which needs to function as normal. Edit I am adding the scroll bar.. the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever..

How to develop or migrate apps for iPhone 5 screen resolution?

http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution

of Xcode . Set a 4 inch launch image for your app. This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing.. image for your app. This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should.. work magically if you had set auto resizing masks properly. If you didn't adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward...

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

myApp.app.dSYM and it just outputs the same text that is in the crash report to start with not symbolicated. Am I doing something wrong Any help would be greatly appreciated thanks. iphone crash.. functionName 510 Symbolicating IPA if we use IPA for symbolicating just rename the extention .ipa with .zip extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative.. I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols... iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced 'Document Support'..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

I would like to have an app include a custom font for rendering text load it and then use it with standard UIKit elements like UILabel. Is this possible I found these links http discussions.apple.com.. for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment.. of replies so far which tell me to read the documentation on X or Y. I've experimented extensively with all of these and got nowhere. In one case X turned out to be relevant only on OS X not on iPhone. Consequently..

How do I do base64 encoding on iphone-sdk?

http://stackoverflow.com/questions/392464/how-do-i-do-base64-encoding-on-iphone-sdk

but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library iphone objective c ios ipad base64 share improve this question There's a nice.. could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library iphone objective c ios ipad base64 share improve this question There's a nice code..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

them you simply define a class that implements the delegate methods you're interested in. Though with delegates that use a formal protocol you must declare your delegate to implement that protocol see below... methods declared in the protocol as @optional like most delegate methods you still need to check with respondsToSelector before calling a particular method on it. Apple recommends this method because it.. a particular method on it. Apple recommends this method because it is more precise doesn't mess with NSObject and can provide better tool support. Speed Optimizations Instead of checking whether a delegate..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

Edit One needs to always query the MAC of the same interface of course. I guess the best bet is with en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by..

Delete/Reset all entries in Core Data?

http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data

it is both fast and safe and can certainly be done programatically at runtime. Update for iOS5 With the introduction of external binary storage allowsExternalBinaryDataStorage or Store in External Record..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to..

How to retrieve user's current city name?

http://stackoverflow.com/questions/1382900/how-to-retrieve-users-current-city-name

What you have to do is setup a CLLocationManager that will find your current coordinates. With the current coordinates you need to use MKReverseGeoCoder to find your location. void viewDidLoad this.. a placemark using the found coordinates MKReverseGeocoder geoCoder MKReverseGeocoder alloc initWithCoordinate newLocation.coordinate geoCoder.delegate self geoCoder start this delegate method is called.. occurs in locating your current location void locationManager CLLocationManager manager didFailWithError NSError error NSLog @ locationManager @ didFailWithError @ manager error this delegate is called..

Objective-C categories in static library

http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library

project icon mylib.a file name shown drag this mylib.a file and drop it into Target Link Binary With Library group. Open target info in fist page General and add my lib to dependencies list after that..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

UTI with the .pdb file extension corresponding to the MIME type chemical x pdb . With this in place your application will be able to handle documents attached to emails or from other applications.. and you will need to handle the processing of this file in your application didFinishLaunchingWithOptions application delegate method. It appears that files loaded in this manner from Mail are copied..

How To Make iPhone App compatible with multiple SDK (firmware) versions

http://stackoverflow.com/questions/3027120/how-to-make-iphone-app-compatible-with-multiple-sdk-firmware-versions

To Make iPhone App compatible with multiple SDK firmware versions With iOS4 coming out soon I have already planned to include an iAd in a future update of an app of mine...

iPhone App Minus App Store?

http://stackoverflow.com/questions/37464/iphone-app-minus-app-store

and patch your iPhone SDK to allow the use of this certificate Launch Keychain Access.app. With no items selected from the Keychain menu select Certificate Assistant then Create a Certificate. Name..

How to link to apps on the app store

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

news id 01062010a Drive Customers Directly to Your App on the App Store with iTunes Links With iTunes links you can provide your customers with an easy way to access your apps on the App Store directly..

iPhone - Backgrounding to poll for events

http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events

if the app was terminated. VoIP apps will be started in background automatically after bootup With abusing this behavior you can make your app be looking like running forever . Register for one background.. application UIApplication app UIApplication sharedApplication bgTask app beginBackgroundTaskWithExpirationHandler ^ app endBackgroundTask bgTask bgTask UIBackgroundTaskInvalid Start the long running.. of the others the system restarts the app in background which will restart your background process With this PingPong I can do a lot of backgrounding. but remember be very spare with CPU time. And save all..

Change User Agent in UIWebView (iPhone SDK)

http://stackoverflow.com/questions/478387/change-user-agent-in-uiwebview-iphone-sdk

for an embedded IE browser in a Windows app iphone cocoa touch share improve this question With iOS 5 changes I recommend the following approach originally from this StackOverflow question UIWebView.. by running this code once when your app starts NSDictionary dictionary NSDictionary dictionaryWithObjectsAndKeys @ Your user agent @ UserAgent nil NSUserDefaults standardUserDefaults registerDefaults..

How do I size a UITextView to its content?

http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content

with addSubview . Prior to that it is equal to frame.size This will not work if auto layout is ON. With auto layout the general approach is to use the sizeThatFits method and update the constant value on..

Xcode 4 - “Valid signing identity not found” error on provisioning profiles on a new Macintosh install

http://stackoverflow.com/questions/6769345/xcode-4-valid-signing-identity-not-found-error-on-provisioning-profiles-on-a

password iphone xcode certificate keychain provisioning profile share improve this question With Xcode 4.2 and later versions including XCode 4.6 there is a better way to migrate your entire developer.. launch Xcode and import the profile you exported above. Works like a charm. Edit for Xcode 4.4 With Xcode 4.4 at step 3 choose Provisioning Profiles under LIBRARY. Then select your provisioning profiles..

iOS: How to store username/password within an app?

http://stackoverflow.com/questions/6972092/ios-how-to-store-username-password-within-an-app

Xcode 4 select your project then select target go to Build Phases tab and click under Link Binary With Files and KeychainItemWrapper .h .m files into your project #import the .h file wherever you need to.. create an instance of this class KeychainItemWrapper keychainItem KeychainItemWrapper alloc initWithIdentifier @ YourAppLogin accessGroup nil YourAppLogin can be anything you chose to call your Keychain..

iPhone Data Usage Tracking/Monitoring

http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring

Tracking Monitoring I've searched over this topic but found very few details which were helpful. With these details I've tried to cook some code as follows. Note Please compare the details shared in this.. networkStatisc ifi_ibytes cursor cursor ifa_next freeifaddrs addrs return NSArray arrayWithObjects NSNumber numberWithInt dataSent NSNumber numberWithInt dataReceived nil This code collects information.. cursor cursor ifa_next freeifaddrs addrs return NSArray arrayWithObjects NSNumber numberWithInt dataSent NSNumber numberWithInt dataReceived nil This code collects information of internet usage..

How do I draw a line on the iPhone?

http://stackoverflow.com/questions/856354/how-do-i-draw-a-line-on-the-iphone

the Library and drag a View component onto your window and position it so you can see all of it. With your new View selected hit Cmd 4 to bring up the Identity Inspector and under Class Identity click the..

To ARC or not to ARC? What are the pros and cons?

http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons

and I'd probably only mention the memory management naming rules while discussing KVC naming. With ARC I believe you could actually become a decent beginning programmer without learning the memory management..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

have moved on a lot since then. Retina makes images bigger and loading them slightly more complex. With the built in support for iPad and retina images you should certainly use ImageNamed in your code. Now.. KBs when compressed but consumes over half a MB decompressed width height 4 . By contrast imageWithContentsOfFile will decompress that image everytime the image data is needed. As you can imagine if you.. alternatives although the one I would recommend primarily is to avoid redrawing that large image . With respect to the general behavior of the cache it does cache based on filename so two instances of imageNamed..

How to check for an active Internet Connection on iPhone SDK?

http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk

Internet Connection on iPhone SDK I would like to check to see if I have an Internet connection on the iPhone using the Cocoa Touch libraries. I came up with a way to do this using an NSURL . The way I did it seems a bit unreliable because even Google could one day be down and relying on a 3rd party seems bad and while.. testing for a gateway to any domain. Important Note The Reachability class is one of the most used classes in projects so you might run into naming conflicts with other projects like ShareKit. If this happens you'll have to rename one of the pairs of Reachability.h and Reachability.m files to something else to resolve the..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyboard.. the components as possible will be done in Interface Builder. I'd like to only write code for what needs it. Note the UIView or UIScrollView that I'm working with is brought up by a tabbar UITabBar which needs to function as normal. Edit I am adding the scroll bar just for when the keyboard comes up. Even though it's not.. iPhone screen. If you are adding the scroll view just to make the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is shown. Here is some sample code #define..

How to develop or migrate apps for iPhone 5 screen resolution?

http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution

share improve this question Download and install latest version of Xcode . Set a 4 inch launch image for your app. This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should work magically if you had set.. and install latest version of Xcode . Set a 4 inch launch image for your app. This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should work magically if you had set auto resizing masks properly... app and hopefully do nothing else since everything should work magically if you had set auto resizing masks properly. If you didn't adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward. If there is something you have to do for the larger screen..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

What now I have tried invoking symbolicatecrash crashreport.crash myApp.app.dSYM and it just outputs the same text that is in the crash report to start with not symbolicated. Am I doing something wrong Any help would be greatly appreciated thanks. iphone crash reports symbolicate share improve this question Steps.. exact line method name which resulted in crash. Ex classname functionName 510 Symbolicating IPA if we use IPA for symbolicating just rename the extention .ipa with .zip extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file. Note This can only work if the app binary does not have..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated with.. do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced.. an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced 'Document Support' which goes a step further and allows apps to associate with..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

I embed a custom font in an iPhone application I would like to have an app include a custom font for rendering text load it and then use it with standard UIKit elements like UILabel. Is this possible I found these links http discussions.apple.com thread.jspa messageID 8304744 http forums.macrumors.com showthread.php.. glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff downloaded from here and added.. font name was Harrowprint. EDIT there have been a number of replies so far which tell me to read the documentation on X or Y. I've experimented extensively with all of these and got nowhere. In one case X turned out to be relevant only on OS X not on iPhone. Consequently I am setting a bounty for this question and I will..

How do I do base64 encoding on iphone-sdk?

http://stackoverflow.com/questions/392464/how-do-i-do-base64-encoding-on-iphone-sdk

on iphone sdk I'd like to do base64 encoding and decoding but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library iphone objective c ios ipad base64 share improve this question There's a nice code sample at the bottom of this post. Very self contained..... sdk I'd like to do base64 encoding and decoding but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library iphone objective c ios ipad base64 share improve this question There's a nice code sample at the bottom of this post. Very self contained... BaseSixtyFour..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

delegate of another. There's no special process for creating them you simply define a class that implements the delegate methods you're interested in. Though with delegates that use a formal protocol you must declare your delegate to implement that protocol see below. For example suppose you have an NSWindow. If you'd like.. ... @end And then implement the methods in the protocol. For methods declared in the protocol as @optional like most delegate methods you still need to check with respondsToSelector before calling a particular method on it. Apple recommends this method because it is more precise doesn't mess with NSObject and can provide.. you still need to check with respondsToSelector before calling a particular method on it. Apple recommends this method because it is more precise doesn't mess with NSObject and can provide better tool support. Speed Optimizations Instead of checking whether a delegate responds to a selector every time we want to message it..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

the MAC address. You could query the MAC and use that as UUID. Edit One needs to always query the MAC of the same interface of course. I guess the best bet is with en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor..

Delete/Reset all entries in Core Data?

http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data

to persist your changes. Just removing the store and recreating it is both fast and safe and can certainly be done programatically at runtime. Update for iOS5 With the introduction of external binary storage allowsExternalBinaryDataStorage or Store in External Record File in iOS 5 and OS X 10.7 simply deleting files pointed..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to Allow scrolling of the contents of the UIScrollView to see the..

How to retrieve user's current city name?

http://stackoverflow.com/questions/1382900/how-to-retrieve-users-current-city-name

iphone objective c core location share improve this question What you have to do is setup a CLLocationManager that will find your current coordinates. With the current coordinates you need to use MKReverseGeoCoder to find your location. void viewDidLoad this creates the CCLocationManager that will find your current.. CLLocation oldLocation this creates a MKReverseGeocoder to find a placemark using the found coordinates MKReverseGeocoder geoCoder MKReverseGeocoder alloc initWithCoordinate newLocation.coordinate geoCoder.delegate self geoCoder start this delegate method is called if an error occurs in locating your current location void.. self geoCoder start this delegate method is called if an error occurs in locating your current location void locationManager CLLocationManager manager didFailWithError NSError error NSLog @ locationManager @ didFailWithError @ manager error this delegate is called when the reverseGeocoder finds a placemark void reverseGeocoder..

Objective-C categories in static library

http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library

or add it with Project Add to project . Click on arrow at lib project icon mylib.a file name shown drag this mylib.a file and drop it into Target Link Binary With Library group. Open target info in fist page General and add my lib to dependencies list after that all works OK. ObjC flag was enough in my case. I also was interested..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

This particular example exports the com.sunsetlakesoftware.molecules.pdb UTI with the .pdb file extension corresponding to the MIME type chemical x pdb . With this in place your application will be able to handle documents attached to emails or from other applications on the system. In Mail you can tap and hold to bring.. When the attachment is opened your application will be started and you will need to handle the processing of this file in your application didFinishLaunchingWithOptions application delegate method. It appears that files loaded in this manner from Mail are copied into your application's Documents directory under a subdirectory..

How To Make iPhone App compatible with multiple SDK (firmware) versions

http://stackoverflow.com/questions/3027120/how-to-make-iphone-app-compatible-with-multiple-sdk-firmware-versions

To Make iPhone App compatible with multiple SDK firmware versions With iOS4 coming out soon I have already planned to include an iAd in a future update of an app of mine. I assume that this will make my app unusable for anyone on a..

iPhone App Minus App Store?

http://stackoverflow.com/questions/37464/iphone-app-minus-app-store

Certificate First you'll need to create a self signed certificate and patch your iPhone SDK to allow the use of this certificate Launch Keychain Access.app. With no items selected from the Keychain menu select Certificate Assistant then Create a Certificate. Name iPhone Developer Certificate Type Code Signing Let me override..

How to link to apps on the app store

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

store share improve this question From https developer.apple.com news id 01062010a Drive Customers Directly to Your App on the App Store with iTunes Links With iTunes links you can provide your customers with an easy way to access your apps on the App Store directly from your website or marketing campaigns. Creating an..

iPhone - Backgrounding to poll for events

http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events

location updates will be automatically restarted in background if the app was terminated. VoIP apps will be started in background automatically after bootup With abusing this behavior you can make your app be looking like running forever . Register for one background process i.e. VoIP . This will cause your app to be restarted.. your app. void applicationDidEnterBackground UIApplication application UIApplication app UIApplication sharedApplication bgTask app beginBackgroundTaskWithExpirationHandler ^ app endBackgroundTask bgTask bgTask UIBackgroundTaskInvalid Start the long running task and return immediately. dispatch_async dispatch_get_global_queue.. a while. But because you registered your app as VoIP or one of the others the system restarts the app in background which will restart your background process With this PingPong I can do a lot of backgrounding. but remember be very spare with CPU time. And save all data to restore your views your app will be terminated some..

Change User Agent in UIWebView (iPhone SDK)

http://stackoverflow.com/questions/478387/change-user-agent-in-uiwebview-iphone-sdk

the existing iPhone SDK's UIWebView control the way it is say for an embedded IE browser in a Windows app iphone cocoa touch share improve this question With iOS 5 changes I recommend the following approach originally from this StackOverflow question UIWebView iOS5 changing user agent as pointed out in an answer below... work in 4.3 and earlier also. Change the UserAgent default value by running this code once when your app starts NSDictionary dictionary NSDictionary dictionaryWithObjectsAndKeys @ Your user agent @ UserAgent nil NSUserDefaults standardUserDefaults registerDefaults dictionary See previous edits on this post if you need methods..

How do I size a UITextView to its content?

http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content

available after the UITextView has been added to the view with addSubview . Prior to that it is equal to frame.size This will not work if auto layout is ON. With auto layout the general approach is to use the sizeThatFits method and update the constant value on a height constraint. CGSize sizeThatShouldFitTheContent _textView..

Xcode 4 - “Valid signing identity not found” error on provisioning profiles on a new Macintosh install

http://stackoverflow.com/questions/6769345/xcode-4-valid-signing-identity-not-found-error-on-provisioning-profiles-on-a

and after having entered my provisioning portal login and password iphone xcode certificate keychain provisioning profile share improve this question With Xcode 4.2 and later versions including XCode 4.6 there is a better way to migrate your entire developer profile to a new machine. On your existing machine launch.. you to choose a file name and password. On your new machine launch Xcode and import the profile you exported above. Works like a charm. Edit for Xcode 4.4 With Xcode 4.4 at step 3 choose Provisioning Profiles under LIBRARY. Then select your provisioning profiles either with the mouse or Command A. Also Apple is making..

iOS: How to store username/password within an app?

http://stackoverflow.com/questions/6972092/ios-how-to-store-username-password-within-an-app

click on frameworks folder and add existing framework. In Xcode 4 select your project then select target go to Build Phases tab and click under Link Binary With Files and KeychainItemWrapper .h .m files into your project #import the .h file wherever you need to use keychain and then create an instance of this class KeychainItemWrapper.. #import the .h file wherever you need to use keychain and then create an instance of this class KeychainItemWrapper keychainItem KeychainItemWrapper alloc initWithIdentifier @ YourAppLogin accessGroup nil YourAppLogin can be anything you chose to call your Keychain item and you can have multiple items if required Then you..

iPhone Data Usage Tracking/Monitoring

http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring

Data Usage Tracking Monitoring I've searched over this topic but found very few details which were helpful. With these details I've tried to cook some code as follows. Note Please compare the details shared in this post with other posts before marking this as DUPLICATE and.. if type WWAN dataSent networkStatisc ifi_obytes dataReceived networkStatisc ifi_ibytes cursor cursor ifa_next freeifaddrs addrs return NSArray arrayWithObjects NSNumber numberWithInt dataSent NSNumber numberWithInt dataReceived nil This code collects information of internet usage of an iPhone device and not my application.. networkStatisc ifi_obytes dataReceived networkStatisc ifi_ibytes cursor cursor ifa_next freeifaddrs addrs return NSArray arrayWithObjects NSNumber numberWithInt dataSent NSNumber numberWithInt dataReceived nil This code collects information of internet usage of an iPhone device and not my application alone . Now if I..

How do I draw a line on the iPhone?

http://stackoverflow.com/questions/856354/how-do-i-draw-a-line-on-the-iphone

see a window named Window . Hit Cmd Shift L to bring up the Library and drag a View component onto your window and position it so you can see all of it. With your new View selected hit Cmd 4 to bring up the Identity Inspector and under Class Identity click the dropdown and choose MyView. Next you need to implement the..

To ARC or not to ARC? What are the pros and cons?

http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons

no more than five minutes on the actual memory management rules and I'd probably only mention the memory management naming rules while discussing KVC naming. With ARC I believe you could actually become a decent beginning programmer without learning the memory management rules at all. But you couldn't become a decent intermediate..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

dates from iOS 1.0 Image requirements and handling handling have moved on a lot since then. Retina makes images bigger and loading them slightly more complex. With the built in support for iPad and retina images you should certainly use ImageNamed in your code. Now for posterity's sake The sister thread on the Apple Dev Forums.. for example a screen sized PNG file might consume a few dozen KBs when compressed but consumes over half a MB decompressed width height 4 . By contrast imageWithContentsOfFile will decompress that image everytime the image data is needed. As you can imagine if you only need the image data once you've won nothing here except.. a large image that you need to redraw often then there are alternatives although the one I would recommend primarily is to avoid redrawing that large image . With respect to the general behavior of the cache it does cache based on filename so two instances of imageNamed with the same name should result in references to the..

How to check for an active Internet Connection on iPhone SDK?

http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk

I would like to check to see if I have an Internet connection on the iPhone using the Cocoa Touch libraries. I came up with a way to do this using an NSURL . The way I did it seems a bit unreliable because even Google could one day be down and.. Note The Reachability class is one of the most used classes in projects so you might run into naming conflicts with other projects like ShareKit. If this happens you'll have to rename one of the pairs of Reachability.h and Reachability.m..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to Allow scrolling of the contents of the UIScrollView to see.. in Interface Builder. I'd like to only write code for what needs it. Note the UIView or UIScrollView that I'm working with is brought up by a tabbar UITabBar which needs to function as normal. Edit I am adding the scroll bar just for when the.. view just to make the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is..

How to develop or migrate apps for iPhone 5 screen resolution?

http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution

install latest version of Xcode . Set a 4 inch launch image for your app. This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything.. . Set a 4 inch launch image for your app. This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should work magically if.. everything should work magically if you had set auto resizing masks properly. If you didn't adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward. If there is something..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

crashreport.crash myApp.app.dSYM and it just outputs the same text that is in the crash report to start with not symbolicated. Am I doing something wrong Any help would be greatly appreciated thanks. iphone crash reports symbolicate.. crash. Ex classname functionName 510 Symbolicating IPA if we use IPA for symbolicating just rename the extention .ipa with .zip extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file. Note This can..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned.. do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols. That was almost.. of associating your iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced 'Document Support' which goes a step..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

in an iPhone application I would like to have an app include a custom font for rendering text load it and then use it with standard UIKit elements like UILabel. Is this possible I found these links http discussions.apple.com thread.jspa messageID.. like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff.. have been a number of replies so far which tell me to read the documentation on X or Y. I've experimented extensively with all of these and got nowhere. In one case X turned out to be relevant only on OS X not on iPhone. Consequently I am setting..

How do I do base64 encoding on iphone-sdk?

http://stackoverflow.com/questions/392464/how-do-i-do-base64-encoding-on-iphone-sdk

encoding and decoding but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library iphone objective c ios ipad base64 share improve this question There's a nice code sample at the.. and decoding but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library iphone objective c ios ipad base64 share improve this question There's a nice code sample at the bottom..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

process for creating them you simply define a class that implements the delegate methods you're interested in. Though with delegates that use a formal protocol you must declare your delegate to implement that protocol see below. For example suppose.. in the protocol. For methods declared in the protocol as @optional like most delegate methods you still need to check with respondsToSelector before calling a particular method on it. Apple recommends this method because it is more precise doesn't.. before calling a particular method on it. Apple recommends this method because it is more precise doesn't mess with NSObject and can provide better tool support. Speed Optimizations Instead of checking whether a delegate responds to a selector..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

and use that as UUID. Edit One needs to always query the MAC of the same interface of course. I guess the best bet is with en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred..

Delete/Reset all entries in Core Data?

http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data

store and recreating it is both fast and safe and can certainly be done programatically at runtime. Update for iOS5 With the introduction of external binary storage allowsExternalBinaryDataStorage or Store in External Record File in iOS 5 and..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to Allow scrolling of the..

How to retrieve user's current city name?

http://stackoverflow.com/questions/1382900/how-to-retrieve-users-current-city-name

improve this question What you have to do is setup a CLLocationManager that will find your current coordinates. With the current coordinates you need to use MKReverseGeoCoder to find your location. void viewDidLoad this creates the CCLocationManager.. to find a placemark using the found coordinates MKReverseGeocoder geoCoder MKReverseGeocoder alloc initWithCoordinate newLocation.coordinate geoCoder.delegate self geoCoder start this delegate method is called if an error occurs.. is called if an error occurs in locating your current location void locationManager CLLocationManager manager didFailWithError NSError error NSLog @ locationManager @ didFailWithError @ manager error this delegate is called when the reverseGeocoder..

Objective-C categories in static library

http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library

Click on arrow at lib project icon mylib.a file name shown drag this mylib.a file and drop it into Target Link Binary With Library group. Open target info in fist page General and add my lib to dependencies list after that all works OK. ObjC flag..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

com.sunsetlakesoftware.molecules.pdb UTI with the .pdb file extension corresponding to the MIME type chemical x pdb . With this in place your application will be able to handle documents attached to emails or from other applications on the system... will be started and you will need to handle the processing of this file in your application didFinishLaunchingWithOptions application delegate method. It appears that files loaded in this manner from Mail are copied into your application's..

How To Make iPhone App compatible with multiple SDK (firmware) versions

http://stackoverflow.com/questions/3027120/how-to-make-iphone-app-compatible-with-multiple-sdk-firmware-versions

To Make iPhone App compatible with multiple SDK firmware versions With iOS4 coming out soon I have already planned to include an iAd in a future update of an app of mine. I assume that this will..

iPhone App Minus App Store?

http://stackoverflow.com/questions/37464/iphone-app-minus-app-store

a self signed certificate and patch your iPhone SDK to allow the use of this certificate Launch Keychain Access.app. With no items selected from the Keychain menu select Certificate Assistant then Create a Certificate. Name iPhone Developer Certificate..

How to link to apps on the app store

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

https developer.apple.com news id 01062010a Drive Customers Directly to Your App on the App Store with iTunes Links With iTunes links you can provide your customers with an easy way to access your apps on the App Store directly from your website..

iPhone - Backgrounding to poll for events

http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events

restarted in background if the app was terminated. VoIP apps will be started in background automatically after bootup With abusing this behavior you can make your app be looking like running forever . Register for one background process i.e. VoIP.. UIApplication application UIApplication app UIApplication sharedApplication bgTask app beginBackgroundTaskWithExpirationHandler ^ app endBackgroundTask bgTask bgTask UIBackgroundTaskInvalid Start the long running task and return immediately... app as VoIP or one of the others the system restarts the app in background which will restart your background process With this PingPong I can do a lot of backgrounding. but remember be very spare with CPU time. And save all data to restore your..

Change User Agent in UIWebView (iPhone SDK)

http://stackoverflow.com/questions/478387/change-user-agent-in-uiwebview-iphone-sdk

the way it is say for an embedded IE browser in a Windows app iphone cocoa touch share improve this question With iOS 5 changes I recommend the following approach originally from this StackOverflow question UIWebView iOS5 changing user.. UserAgent default value by running this code once when your app starts NSDictionary dictionary NSDictionary dictionaryWithObjectsAndKeys @ Your user agent @ UserAgent nil NSUserDefaults standardUserDefaults registerDefaults dictionary See previous..

How do I size a UITextView to its content?

http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content

added to the view with addSubview . Prior to that it is equal to frame.size This will not work if auto layout is ON. With auto layout the general approach is to use the sizeThatFits method and update the constant value on a height constraint...

Xcode 4 - “Valid signing identity not found” error on provisioning profiles on a new Macintosh install

http://stackoverflow.com/questions/6769345/xcode-4-valid-signing-identity-not-found-error-on-provisioning-profiles-on-a

portal login and password iphone xcode certificate keychain provisioning profile share improve this question With Xcode 4.2 and later versions including XCode 4.6 there is a better way to migrate your entire developer profile to a new.. On your new machine launch Xcode and import the profile you exported above. Works like a charm. Edit for Xcode 4.4 With Xcode 4.4 at step 3 choose Provisioning Profiles under LIBRARY. Then select your provisioning profiles either with the mouse..

iOS: How to store username/password within an app?

http://stackoverflow.com/questions/6972092/ios-how-to-store-username-password-within-an-app

framework. In Xcode 4 select your project then select target go to Build Phases tab and click under Link Binary With Files and KeychainItemWrapper .h .m files into your project #import the .h file wherever you need to use keychain and then.. use keychain and then create an instance of this class KeychainItemWrapper keychainItem KeychainItemWrapper alloc initWithIdentifier @ YourAppLogin accessGroup nil YourAppLogin can be anything you chose to call your Keychain item and you can have..

iPhone Data Usage Tracking/Monitoring

http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring

Data Usage Tracking Monitoring I've searched over this topic but found very few details which were helpful. With these details I've tried to cook some code as follows. Note Please compare the details shared in this post with other posts.. ifi_obytes dataReceived networkStatisc ifi_ibytes cursor cursor ifa_next freeifaddrs addrs return NSArray arrayWithObjects NSNumber numberWithInt dataSent NSNumber numberWithInt dataReceived nil This code collects information of internet.. networkStatisc ifi_ibytes cursor cursor ifa_next freeifaddrs addrs return NSArray arrayWithObjects NSNumber numberWithInt dataSent NSNumber numberWithInt dataReceived nil This code collects information of internet usage of an iPhone device..

To ARC or not to ARC? What are the pros and cons?

http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons

memory management rules and I'd probably only mention the memory management naming rules while discussing KVC naming. With ARC I believe you could actually become a decent beginning programmer without learning the memory management rules at all...

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

handling handling have moved on a lot since then. Retina makes images bigger and loading them slightly more complex. With the built in support for iPad and retina images you should certainly use ImageNamed in your code. Now for posterity's sake.. consume a few dozen KBs when compressed but consumes over half a MB decompressed width height 4 . By contrast imageWithContentsOfFile will decompress that image everytime the image data is needed. As you can imagine if you only need the image.. then there are alternatives although the one I would recommend primarily is to avoid redrawing that large image . With respect to the general behavior of the cache it does cache based on filename so two instances of imageNamed with the same..

How to post more parameters with image upload code in iOS?

http://stackoverflow.com/questions/10618056/how-to-post-more-parameters-with-image-upload-code-in-ios

notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A.. DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import Foundation Foundation.h extern NSString const APIKey.. notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A..

Convert UIImage to CMSampleBufferRef

http://stackoverflow.com/questions/16475737/convert-uiimage-to-cmsamplebufferref

_cgImage _uiImage _uiImage resizedImageWithSize CGSizeMake 320 280 CMSampleBufferRef croppedBuffer NEED HELP WITH THIS _videoInput appendSampleBuffer sampleBuffer _videoInput is a AVAssetWriterInput The imageFromSampleBuffer method looks..

OpenGL ES - How to Draw a filled Polygon?

http://stackoverflow.com/questions/3872464/opengl-es-how-to-draw-a-filled-polygon

wiki Polygon_triangulation WIKI http www.flipcode.com archives Efficient_Polygon_Triangulation.shtml polygon WITHOUT holes http www.cs.unc.edu ~dm CODE GEM chapter.html polygon WITH holes C code Solution I will try using polygon tessellation.. Efficient_Polygon_Triangulation.shtml polygon WITHOUT holes http www.cs.unc.edu ~dm CODE GEM chapter.html polygon WITH holes C code Solution I will try using polygon tessellation to get triangles. At first I'm going to try http www.flipcode.com..

Building iPhone Code using xcodebuild and running LLVM/Clang Static Analyzer

http://stackoverflow.com/questions/490835/building-iphone-code-using-xcodebuild-and-running-llvm-clang-static-analyzer

Terminal 2. Go to Project Directly 3. xcodebuild I get this error BUILDING NATIVE TARGET XProject OF PROJECT XProject WITH THE DEFAULT CONFIGURATION Release Checking Dependencies... CodeSign error no certificate found in keychain for code signing..

how to properly use insertRowsAtIndexPaths?

http://stackoverflow.com/questions/6943470/how-to-properly-use-insertrowsatindexpaths

id sender if switch1.on NSIndexPath path1 NSIndexPath indexPathForRow 1 inSection 0 ALSO TRIED WITH indexPathRow 0 NSArray indexArray NSArray arrayWithObjects path1 nil tblSimpleTable insertRowsAtIndexPaths indexArray withRowAnimation..

SFHFKeychainUtils. iOS keychain. ARC compatible

http://stackoverflow.com/questions/7663443/sfhfkeychainutils-ios-keychain-arc-compatible

notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A.. DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import UIKit UIKit.h @interface SFHFKeychainUtils NSObject NSString.. notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A..

Video Encoding using AVAssetWriter - CRASHES

http://stackoverflow.com/questions/8191840/video-encoding-using-avassetwriter-crashes

that is supposed to re encode a video to a manageable bitrate on iphone ipad. Here it is UPDATED WORKING CODE NOW WITH AUDIO void resizeVideo NSString pathy NSString newName pathy stringByAppendingString @ .down.mov NSURL fullPath NSURL fileURLWithPath..

iPhone emoticons insert into MySQL but become blank value

http://stackoverflow.com/questions/9509668/iphone-emoticons-insert-into-mysql-but-become-blank-value

Most iOS emojis use code points above the Basic Multilingual Plane of the Unicode table. For example SMILING FACE WITH OPEN MOUTH AND SMILING EYES is at U 1F604. Now see http dev.mysql.com doc refman 5.5 en charset unicode.html . MySQL before..

Capturing EAGLview content WITH alpha channel on iPhone

http://stackoverflow.com/questions/962390/capturing-eaglview-content-with-alpha-channel-on-iphone

EAGLview content WITH alpha channel on iPhone have been struggling with this issue for quite some time now and couldn't find an answer so far...

Get Exif data from UIImage - UIImagePickerController

http://stackoverflow.com/questions/9766394/get-exif-data-from-uiimage-uiimagepickercontroller

NSDictionary exif_dict __bridge NSDictionary exif NSLog @ exif_dict @ exif_dict save image WITH meta data NSString documentsDirectory NSSearchPathForDirectoriesInDomains NSDocumentDirectory NSUserDomainMask YES objectAtIndex..

Why can't Emoji display correctly in a UITextField?

http://stackoverflow.com/questions/9940278/why-cant-emoji-display-correctly-in-a-uitextfield