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

34593 questions
18
votes
4 answers

Debug WatchKit on real Apple Watch - Nothing happens

I am struggling with debugging my WatchKit Extension/App on a real Apple Watch. Debugging both the iPhone App and the WatchKit Extension using the simulator the simulator is not problem: Select the WatchKit App Profile and run in Simulator ==> App…
Andrei Herford
  • 15,149
  • 16
  • 73
  • 171
18
votes
2 answers

Entering background on iOS4 to play audio

The documentation is rather poorly written when talking about playing audio in the background. It gives the impression that all you have to do to continue playing the audio that you are currently playing is to just add a key/value pair to the…
iwasrobbed
  • 45,197
  • 20
  • 140
  • 190
18
votes
4 answers

How to reset the scroll position of a UITableView?

I would like to completely reset the scroll position of a UITableView, so that every time I open it, it is displaying the top-most items. In other words, I would like to scroll the table view to the top every time it is opened. I tried using the…
jpm
  • 16,162
  • 33
  • 60
  • 66
18
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
  • 42,456
  • 49
  • 169
  • 255
18
votes
16 answers

Installation Failed: Invalid Argument -iOS Extension

https://imgur.com/vFn0S7g I am about to build watch app target from existing project. I encountered a strange error upon finishing build that unables me to run the watch app properly. Here is the attached screenshot. Environment OSX 10.10 XCode 6.2…
Dsw
  • 281
  • 1
  • 2
  • 10
18
votes
3 answers

UIKeyboardTypeNumberPad - Show just numbes on iPad?

UIKeyboardTypeNumberPad doesn't display a number pad on the iPad. Instead, it shows the UIKeyboardTypeNumbersAndPunctuation keyboard. Is there something I'm missing, or has this been removed from the iPad OS? Thanks for your guidance!
Justin
  • 9,042
  • 7
  • 67
  • 97
18
votes
13 answers

UISplitViewController: remove divider line

When using UISplitViewController on the iPad there's a black vertical divider line between the root and detail view. Is there any way to remove this line? Thanks
indragie
  • 17,634
  • 15
  • 89
  • 161
18
votes
3 answers

How to get a swift enum's associated value regardless of the enum case

I have an object FormField which has two properties: a String name, and a value which can accept any type--hence I've made it Any!. However, I've been told in a separate question to use an enum with associated values instead of Any!. enum Value { …
MLQ
  • 12,329
  • 12
  • 79
  • 130
18
votes
4 answers

UIScrollView with pages enabled and device rotation/orientation changes (MADNESS)

I'm having a hard time getting this right. I've got a UIScrollView, with paging enabled. It is managed by a view controller (MainViewController) and each page is managed by a PageViewController, its view added as a subview of the scrollView at the…
jbrennan
  • 11,523
  • 14
  • 69
  • 110
18
votes
5 answers

How to archive and unarchive custom objects in Swift? Or how to save custom object to NSUserDefaults in Swift?

I have a class class Player { var name = "" func encodeWithCoder(encoder: NSCoder) { encoder.encodeObject(name) } func initWithCoder(decoder: NSCoder) -> Player { self.name = decoder.decodeObjectForKey("name") as…
tadasz
  • 4,288
  • 5
  • 24
  • 33
18
votes
4 answers

Badge count is persisted after deleting an app and installing it again

My application has a notification section in it, and the sum of the notifications are displayed in the form of Badge Count on the app icon. When the user accesses the notifications the Badge count decreases. Suppose the User now uninstalls the…
user3568907
  • 317
  • 3
  • 5
18
votes
4 answers

Fill color on specific portion of image?

I want to fill specific color on specific area of an image. EX: In above Joker image, If touch on hair of Joker then fill specific color on hair Or touch on nose then fill specific color on nose.. etc. I hope may you understand what I am trying to…
user2289379
18
votes
4 answers

Average progress of all the NSURLSessionTasks in a NSURLSession

An NSURLSession will allow you to add to it a large number of NSURLSessionTask to download in the background. If you want to check the progress of a single NSURLSessionTask, it’s as easy as double taskProgress = (double)task.countOfBytesReceived /…
Eric
  • 12,878
  • 13
  • 78
  • 119
18
votes
2 answers

iOS: Does force quitting the app disables background upload using NSURLSession?

The question is around NSURLSession and NSURLSessionUploadTask. I'm uploading large files to server and noticed that when I force quit the app the whole background upload just stops. However, when upload starts while app is running through the…
ymotov
  • 1,365
  • 3
  • 16
  • 28
18
votes
6 answers

UITableView Problems with cellForRowAtIndexPath

I am trying to fill a uitableview with multiple sections. This is my code: static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell =…
azban
  • 422
  • 1
  • 4
  • 9
1 2 3
99
100