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
1
vote
2 answers

objective-c dot notation with square brackets

hi i don't understand this code of course CS193p [[PlayingCard rankStrings][self.rank] stringByAppendingString:self.suit]; where rankString is variable method + (NSArray *)rankStrings { return @[@"?", @"A", @"2", @"3", @"4", @"5", @"6", @"7",…
1
vote
0 answers

converting Objective-C lazy instantiation with side effects to Swift

I converted the Objective-C app Dropit from the Stanford CS193P course to Swift. The original code is located at: http://web.stanford.edu/class/cs193p/cgi-bin/drupal/ There are multiple uses of lazy instantiation that perform additional…
kasplat
  • 1,177
  • 3
  • 13
  • 16
1
vote
2 answers

IBOutlet property returning "Can't unwrap Optional.None" error

I'm getting stuck on some code with the dreaded "Can't unwrap Optional.None" error in my code. I'm following the Shutterbug code from the iTunes U Stanford university course. This is the code given in Objective-C for one of the…
Sawyer05
  • 1,604
  • 2
  • 22
  • 37
1
vote
1 answer

crash linked to swift_dynamicCast in prepareForSegue

First of all, here's my code: let flickerFetcher : FlickrFetcher = FlickrFetcher() var photos : UIImage[]? = UIImage[]() { didSet { self.appsTableView.reloadData() } } func prepareImageViewController(ivc: ImageViewController, toDisplayPhoto…
Sawyer05
  • 1,604
  • 2
  • 22
  • 37
1
vote
1 answer

CS193P - Assignment 3 - drawRect get called only on the first setNeedsDisplay

I'm taking CS193P iPhone Development courses, and even if.. I know that I'm pretty late comparing to Stanford's students, I'm doing Assignment 3. My current problem is: My drawRect method does not get called on every setNeedsDisplay... but only…
Tommy B.
  • 3,591
  • 14
  • 61
  • 105
1
vote
1 answer

Calculator Program Xcode Error Expected expression before '@' token

I'm doing the Stanford xcode class CS193P assignment #2 and I'm getting some errors. The tasks is to write a calculator program with variables. I am using Xcode 3.2.6 www.stanford.edu/class/.../Assignment%202_1.pdf I'm getting the error Expected…
1
vote
0 answers

Trouble with NSAttributedString and NSMuttableAttributedString

I have the following code that keeps crashing and can't find why. @property (nonatomic)NSUInteger numberOfShapes; @property (strong, nonatomic)NSString *shapeInCard; @property (strong, nonatomic)UIColor *colorOfShape; @property (nonatomic)float…
gariva
  • 45
  • 4
1
vote
1 answer

Flickr's "getTopPlacesList" API returns "no data"

Taking the Fall, 2013 - Winter, 2014 CS 193p class via iTunes U. I have a valid API key. Even Flickr's "API Explorer" is returning "no data". Link to Flickr's API Explorer for Top Places…
Lee Trent
  • 83
  • 1
  • 11
1
vote
2 answers

UITableView not populated after removing and reinserting CoreDataTableViewController

I'm working on an app using Stanford's CoreDataTableViewController. All database saving and fetching was working correctly until I removed the CDTVC files and then added them again. Now it's not fetching anything. CellForRowAtIndexPath is not being…
kanstraktar
  • 5,357
  • 2
  • 21
  • 29
1
vote
1 answer

range of string does not work correctly whit nsAttributeString

i'm trying to set a set of Nsattributestring for my primary string. the situation is this: for example i have 3 string like this: card1.contents = @"■■"; card2.contents = @"▲▲▲"; card3.contents = @"■■■"; and the last string like…
Max_Power89
  • 1,710
  • 1
  • 21
  • 38
1
vote
2 answers

UIControlStateSelected|UIControlStateDisabled, Objective C Explanation

I am doing the stanford Course Assignments and he posted this code UIControlStateSelected|UIControlStateDisabled what exactly does this mean and what does the | operand do? Also, I am trying to set the value on a button using this code but it wont…
user2076774
  • 405
  • 1
  • 8
  • 21
1
vote
2 answers

cs193p assignment 4 flickr fetcher returns an empty array

I am following the iTunesU lecture of stanford cs193p class, and I am on assignment 4 right now. After I entered the API key in the header file and try to log the returned array to the console, it shows that it is an empty array with nothing in it.…
Enzo
  • 969
  • 1
  • 8
  • 23
1
vote
1 answer

iOS (cs193p): Issue using a delegate in a MapViewController to get an image using a different thread from another controller

I'm following the excellent CS193P lecture on iOS 5.0 development: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/ I'm now at assignment #5, required task #5b. I need to display a callout with a thumbnail in it when I click on an annotation on…
Pascal
  • 85
  • 8
1
vote
1 answer

Can't find the example projects from Stanford cs193p

I am looking for the Flickr multithreaded example application that is used in lecture 10 "Performance and Threading". He does a few things that I would like to look at. The particular files I'm looking for are ImageLoadingOperation.h and…
Jason
  • 17,276
  • 23
  • 73
  • 114
1
vote
1 answer

How are tasks synchronized when dispatched asynchronously on different dispatch queues? (Shutterbug example)

In the Shutterbug example code presented in Lecture 10, Fall 2011, photos are downloaded and then updated into a table view controller using the following code: dispatch_queue_t downloadQueue = dispatch_queue_create("flickr downloader", NULL); …
ChipK
  • 108
  • 7