Questions tagged [cocoa-touch]

The Cocoa Touch Frameworks that drive iOS apps share many proven patterns found on the Mac, but were built with a special focus on touch-based interfaces and optimization.

Cocoa Touch is Apple's application-development framework for , consisting of Foundation, UIKit (), and Core Data ().

The Cocoa Touch frameworks that drive apps share many proven patterns found on the , but were built with a special focus on touch-based interfaces and optimization.

For development, see .

For Cocoapods, see .

Many Cocoa Touch questions deal with , , , or .

Debugging techniques

Cocoa programs can be debugged with many techniques and tools, both general and specific to , , , and .

Apple's Technical Note about debugging iOS applications

34585 questions
20
votes
5 answers

Is it possible to observe a readonly property of an object in Cocoa Touch?

I've attempted to observe the (readonly) visibileViewController property of a UINavigationController with no success. I was able to successfully observe a readwrite property I defined myself for testing purposes on another class. Is it possible to…
user53937
  • 623
  • 1
  • 9
  • 10
20
votes
2 answers

How do I get arctan MATH function in iOS?

How do I get arctan MATH function in iphone SDK?
Devang
  • 11,258
  • 13
  • 62
  • 100
20
votes
5 answers

What is the difference between Delegate and Notification?

What is the difference between Delegate and Notification? I understood like delegate and protocol, @protocol classADelegate -(void)DelegateMethod; @end classB { classA *ObjOfclassA=[[classA alloc]init]; …
rithik
  • 778
  • 1
  • 9
  • 21
20
votes
2 answers

how to dismiss a modal view controller presented as "Form Sheet" when a touch occur outside the form sheet?

I have a View Controller (with a UIWebView) i present in Form Sheet style. I have to put a "Done" button in the UIToolbar of the view in the View Controller to have it dismissed. But, since presenting it in "Form Sheet" style leaves plenty of unused…
mndhkr
  • 211
  • 2
  • 4
20
votes
3 answers

Does Interface Builder use the -init method to initialize view controllers?

I have setup tab bar controller using interface builder, and each tab bar item is linked to a view controller (4 tabs, 4 view controllers). I want to know if Interface Builder uses an -init method to initialize the view controller because apparently…
Mustafa
  • 20,504
  • 42
  • 146
  • 209
20
votes
4 answers

Save NSCache Contents to Disk

I'm writing an app that needs to keep an in-memory cache of a bunch of objects, but that doesn't get out of hand so I'm planning on using NSCache to store it all. Looks like it will take care of purging and such for me, which is fantastic. I'd also…
Cory Imdieke
  • 14,140
  • 8
  • 36
  • 46
20
votes
2 answers

How can I know when UNUserNotificationCenter's removeAllPendingNotificationRequests() has completed?

The iOS docs say that UNUserNotificationCenter's removeAllPendingNotificationRequests() is asynchronous. What I want to do is this: Call removeAllPendingNotificationRequests() to get rid of all my scheduled notifications Schedule a bunch of new…
Erik Westwig
  • 713
  • 4
  • 16
20
votes
7 answers

How do I reset after a UIScrollView zoom?

I have a Graph being drawn inside a UIScrollView. It's one large UIView using a custom subclass of CATiledLayer as its layer. When I zoom in and out of the UIScrollView, I want the graph to resize dynamically like it does when I return the graph…
Ed Marty
  • 39,590
  • 19
  • 103
  • 156
20
votes
2 answers

What type of reference does NSNotificationCenter keep for 'observer's & 'object's?

Can anyone clarify/elucidate the situation with respect to -[NSNotificationCenter addObserver:selector:name:object:]? What types of references are kept by the notification center of the 'observer' and 'object' arguments? What are the best practices…
Todd Ditchendorf
  • 11,217
  • 14
  • 69
  • 123
20
votes
1 answer

How can I save the fatalError message to the iOS crash log?

I have an iOS application written in Swift 2 in Xcode 8.2.1, that's built for iOS 10.2. I've had a number of crash reports from TestFlight and despite symbolication, none of the crash logs show any program state besides the stack-traces (no argument…
Dai
  • 141,631
  • 28
  • 261
  • 374
20
votes
2 answers

Is there a way to get the Bundle ID at runtime?

Is there a way to get the Bundle ID from Info.plist at runtime? Something like [[UIApplication sharedApplication] bundleIdentifier] would be great.
brian
  • 3,344
  • 2
  • 26
  • 35
20
votes
1 answer

How to use a xib and a UIView subclass together?

I'd like to create a couple of custom views, sort of reusable UI components, and would prefer to not layout the UI in code in the UIView subclass. I'd like to use a xib for that. I've used a xib by itself. And I've used a UIView subclass by iteself.…
Ron
  • 271
  • 1
  • 2
  • 8
20
votes
7 answers

Manually setting a UIButton state

I UIButton using + buttonWithType: What I need to figure out is how to manually change the button state. There are times when I need it to be set to "disabled." I read through the UIButton documentation but I cannot seem to find anything about…
acreek
  • 325
  • 1
  • 3
  • 8
20
votes
2 answers

Changing color of UITableViewCellAccessoryCheckmark and UITextField

I want to change the color of UITableViewCellAccessoryCheckmark and UITextField background color where we type. I found this is not straight forward.
Dilshan
  • 3,231
  • 4
  • 39
  • 50
20
votes
1 answer

Where to put open-source credit information for an iPhone app?

I'm finalizing my first iPhone apps; and wonder where should I put credit information for open-sources I used in my iPhone app? Should I put it directly in my app (users can see it if they press "About" button) or put it in a file go along with the…
KONG
  • 7,271
  • 6
  • 28
  • 27