Questions tagged [cs193p]

CS193P is an iOS programming course offered at Stanford University. The latest Fall 2017 session videos, lecture slides and assignments are available on iTunes U, and have become a popular way of learning to program for the platform.

CS193P is an iOS () programming course offered at Stanford University. The latest Fall 2017 session videos, lecture slides, and assignments focus on iOS 11 and Swift 4 () and are available on iTunes U. This course has become a popular way of learning to program for the platform.

References:

173 questions
14
votes
2 answers

isKindOfClass and NSStringFromClass disagree about UIApplicationDelegate

I was playing with a simple OCUnit test for an iPhone app, and just wanted to assert that the app delegate was an instance of the class that I expected it to be. I didn't expect this test to be very useful, but it turned out to reveal a…
pohl
  • 3,158
  • 1
  • 30
  • 48
13
votes
4 answers

‘CGFloat’ is not convertible to ‘UInt8' and other CGFloat issues with Swift and Xcode 6 beta 4

In case this illuminates the problem, here's the original Objective-C code. int x = (arc4random()%(int)(self.gameView.bounds.size.width*5)) - (int)self.gameView.bounds.size.width*2; int y = self.gameView.bounds.size.height; drop.center =…
kasplat
  • 1,177
  • 3
  • 13
  • 16
11
votes
2 answers

How do I create a global UIManagedDocument instance per document-on-disk shared by my whole application using blocks?

I am trying to design a helper method which will retrieve a UIManagedDocument, then open and return it, so that I may access the same UIManagedDocument from several places in my app. I am having trouble with the asynchronous nature of this as I am…
Alan
  • 4,325
  • 3
  • 21
  • 25
11
votes
4 answers

:0: error: unexpected input file:

I downloaded files from a separate Stack OverFlow post, and dragged the folder into my project (as a group.) The dependancies get resolved and it shows no error for code that relies on the files, but when I try to compile I get this…
John
  • 465
  • 6
  • 14
11
votes
5 answers

_BSMachError while running Stanford's CS193p Smashtag app

I downloaded the Smasthag demo app from course's site. Project builds fine (after small changes in Twitter, TwitterRequest etc. classes, because I use the latest Xcode 7b4) and works fine on simulator (I also had to add NSAppTransportSecurity key to…
Sebastian Osiński
  • 2,894
  • 3
  • 22
  • 34
10
votes
7 answers

How to remove UIButton's image for certain states?

I'm working on a card game. I want the card backs to show an image and the card fronts to show the card contents. I've gotten the image to show on the back, but I can't figure out how to clear it when it's selected. (All the…
Joel Derfner
  • 2,207
  • 6
  • 33
  • 45
9
votes
3 answers

How can I create a variable sized UITableViewCell?

I can't seem to get the text to actually span multiple lines. The heights look correct. What am I missing? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = …
Jason
  • 17,276
  • 23
  • 73
  • 114
7
votes
10 answers

CS193P - Adding floating point button to iOS calculator

I recently started following the online course on iPhone development from Stanford University on iTunes U. I'm trying to do the homework assignments now for the first couple of lectures. I followed through the walkthrough where I built a basic…
Joris Ooms
  • 11,880
  • 17
  • 67
  • 124
7
votes
8 answers

UIViewController throwing unrecognized selector exception on prepareForSegue

I'm trying to follow along the Stanford CS193p iOS programing lectures. One of the demo programs, called "Happiness" creates two UIViewControllers, a "PsychViewController" and a "HappinessViewController." It segues from the PsychViewController to…
user1790252
  • 506
  • 5
  • 13
6
votes
6 answers

CS193P Assignment 3, Hint#5 - What is the model?

I am working my way through the Stanford Fall 2011 iOS course: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/ I am onto assignment#3: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/assignments/Assignment%203_2.pdf As a…
Khaled Barazi
  • 8,681
  • 6
  • 42
  • 62
6
votes
1 answer

IOS CS193p - Why was the IBAction connection dragged to .m file and not to .h?

I noticed that in the calculator demo of Stanford CS193p course, the IBOutlet connection was dragged from the label to header file. However, the IBAction connection was directly created in the .m file. I tried reading through the documentation and…
Rahul
  • 12,886
  • 13
  • 57
  • 62
5
votes
4 answers

Winter 2015 / Lecture 10 - Broken Twitter Package

Trying to follow along and code the Smashtag project while watching the Lecture 10 iTunes video. When I add the dowloaded Twitter package to my Smashtag project, XCode couldn't find the Tweet class when I made reference to it in the…
Lee Trent
  • 83
  • 1
  • 11
5
votes
2 answers

Is there a shortcut to get to the /Resources/ folder in iPhone development?

Is there a shortcut method much like NSHomeDirectory() and NSTemporaryDirectory to get to the resources folder within your project? Is the /resources/ folder the best place to be storing a file?
Jason
  • 17,276
  • 23
  • 73
  • 114
4
votes
1 answer

CS193P Cassini code runs on simulator but crashes on device? "Message from debugger: Terminated due to Memory Error"

I'm going through Stanford's CS193P online course doing ios dev. Lecture 9 deals with UIScrollView / delegation via simple url UIImage fetch app. Said app works perfectly fine in simulator but launches then crashes on live device (iPhone5) after…
John
  • 465
  • 6
  • 14
4
votes
5 answers

How to draw a perfect squiggle in set card game with objective-c?

I'm trying to draw squiggle in Set Card Game. The output is not even close to what I want. How should I improve the drawing? Please ignore the shading in "What I want" picture. I have figured out how to do that. The question is how to drawing the…
dumduke
  • 471
  • 4
  • 15
1
2 3
11 12