objective c - Having images in a picker for iPhone app -


I am writing an iPhone app in which I have a double component picker, aside from 13 different card prices (Ace, 2, 3, 4, etc.) and the other should have a picture for four suits (spades, hearts, diamonds, clubs). I have four in the folder. PNG files dragged.

Can anyone tell me why this code does not work? I'm following almost an example from the class.

  UIImage * spades = [UIImage imageNamed: @ "spades.png"]; UIImage * heart = [UIImage imageNamed: @ "heart.png"]; UIImage * Diamonds = [UIImage imageNamed: @ "diamonds.png"]; UIImage * Club = [UIImage imageNamed: @ "clubs.png"]; UIImageView * spadesView = [[UIImageView alloc] initWithImage: spades]; UIImageView * See heart = [[UIImageView alloc] initWithImage: heart]; UIImageView * diamondsView = [[UIImageView alloc] initWithImage: Diamonds]; UIImageView * clubsView = [[UIImageView alloc] initWithImage: Club]; NSArray * SuitArere = [[NSArray alloc] initWithObjects: spadesView, heart view, diamondsView, clubsView, zero]; Self.suits = suitsArray;   

When I try to do it (below), then it works.

  NSArray * suitarere = [[NSARROL] initWithObjects: @ "Hukum", @ "Hearts", @ "Diamonds", @ "Club", Zero]; Self.suits = suitsArray;   

Any ideas?

Try it, it can work:

  - (Zero) popsout array {NSMutableArray * suitarere = [[NSMUTABELRROL] initWithCapacity: 4]; UIImage * spades = [UIImage imageNamed: @ "spades.png"]; UIImageView * spadesView = [[UIImageView alloc] initWithImage: spades]; [Suitsayer ad object: spadescape]; [SpadesView release]; UIImage * heart = [UIImage imageNamed: @ "heart.png"]; UIImageView * See heart = [[UIImageView alloc] initWithImage: heart]; [Suitsayer ad object: spadescape]; [SpadesView release]; UIImage * Diamonds = [UIImage imageNamed: @ "diamonds.png"]; UIImageView * diamondsView = [[UIImageView alloc] initWithImage: Diamonds]; [Suitsayer ad object: diamond scene]; [See diamond view]; UIImage * Club = [UIImage imageNamed: @ "clubs.png"]; UIImageView * clubsView = [[UIImageView alloc] initWithImage: Club]; [Suitre Ad Object: Clubview]; [Club View Release]; Self.suits = suitsArray; [SuiteArere release]; // if your suit is a maintained asset then}    

Comments