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
13 answers

Duplicate interface declaration for class 'Foo'

I was working on my program, and it seems something in the settings changed. Suddenly I have the error "Duplicate interface declaration for class 'Foo'". It mentions a header file being duplicated but there's only one copy. Interestingly this is…
John Smith
  • 12,491
  • 18
  • 65
  • 111
20
votes
4 answers

UIAlertView Delegates

Can someone explain how the delegate to a UIAlertView works? Is it automatically called or do I have to call it? Eg: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
Joe
  • 1,326
  • 7
  • 34
  • 52
20
votes
6 answers

Ignoring certificate errors with NSURLConnection

I am getting this error The certificate for this server is invalid. You might be connecting to a server that is pretending to be "server addres goes here" which could put your confidential information at risk." I am using this…
Ideveloper
  • 1,467
  • 4
  • 23
  • 44
20
votes
6 answers

Is calling UICollectionView.reloadData() bad practice? If so, why?

I worked with a brilliant developer once who more or less refused to ever call reloadData() on a UICollectionView. He even frowned upon collectionView.reloadItemsAtIndexPaths(collectionView.indexPathsForVisibleItems()), preferring instead to reload…
buildsucceeded
  • 4,203
  • 4
  • 34
  • 72
20
votes
7 answers

Combining a UILongPressGestureRecognizer with a UIPanGestureRecognizer

I d'like to combine a UILongPressGestureRecognizer with a UIPanGestureRecognizer. The UIPanGestureRecognizer should start with a long press. Is there a simple way to do this? or do I really have to write my own gesture recognizer? I wan't something…
20
votes
9 answers

COMET (server push to client) on iPhone

I'm looking to establish some kind of socket/COMET type functionality from my server(s) to my iPhone application. Essentially, anytime a user manages to set an arbitrary object 'dirty' on the server, by say, updating their Address.. the feedback…
Coocoo4Cocoa
  • 48,756
  • 50
  • 150
  • 175
20
votes
7 answers

could not locate an NSManagedObjectModel for entity name

This is the code for toggleAddProject method, the Core Data code is almost the same as found in Apple's CoreDataBooks sample, however when I click the add button the app crashes with entityForName: could not locate an NSManagedObjectModel for entity…
ChrisJP
  • 975
  • 1
  • 7
  • 15
20
votes
6 answers

XCode Documentation - Offline Reading

Is it possible to have the iOS and OSX documentation available for offline reading? If so, how?
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
20
votes
4 answers

Possible to add another item to an existing enum type?

I wonder whether it is possible to add/append another item to an existing enum type (part of a framework)? Something like this: We have the enum type typedef enum { UIModalTransitionStyleCoverVertical = 0, …
user325746
  • 251
  • 1
  • 3
  • 6
20
votes
2 answers

Check if constant is defined at runtime in Obj-C

To, for example, access variables in a NSDictionary Cocoa frameworks often define keys, such as UIKeyboardBoundsUserInfoKey. How can I check if a key is defined at runtime? I found examples on how to check for classes and functions, but not for…
Johan Kool
  • 15,637
  • 8
  • 64
  • 81
20
votes
3 answers

WWDC 2010 Sample Code

Where can I download the WWDC 2010 code samples? I am a registered iPhone developer, but can't seem to find the samples on Apple's site.
Adam Ernst
  • 52,440
  • 18
  • 59
  • 71
20
votes
3 answers

How to calculate a point with an given center, angle and radius?

In this SO question, someone asked for calculating an angle from three points. I need to do the opposite thing. I want to draw a clock, and I have tiny tick images. An art dude made 60 of them, each with an individual and accurate shadow. So there…
dontWatchMyProfile
  • 45,440
  • 50
  • 177
  • 260
20
votes
1 answer

Detect if iOS App is Downloaded from Apple's Testflight

In the past I've had separate build configurations for production and beta builds distributed through TestFlight. This made it easy to make modifications to beta builds, such as exposing additional settings the app to let testers test things more…
Anthony Mattox
  • 7,048
  • 6
  • 43
  • 59
20
votes
4 answers

cocoa touch framework assets not visible in App Project

I've been trying since morning creating a cocoa touch farmework to put my self containing widget inside it, and to allow any app I'm working on to use it in the future. I've managed to build the project and export .framework file, but all the assets…
Mr.Me
  • 9,192
  • 5
  • 39
  • 51
20
votes
9 answers

Converting plist to binary plist

Apple strongly recommends using the binary plist format when reading large XML-based data sets into iPhone apps. Among their reasoning is the fact that XML parsing is very taxing on the iPhone. However, this requires that files residing on the…
Brian Cline
  • 20,012
  • 6
  • 26
  • 25