Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-30-2010, 09:36 AM   #1 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Arrow App CRASHES on loop!

Hi, can someone help me figure out what is wrong with this class I made? When I execute it, the application instantly crashes.

[NOTE: There are no fatal errors or warnings when I build it.]

Code:
-(void) generateMap {
	for (int blockX = 0; blockX < 10; blockX++){
		for (int blockY = 0; blockY < 10; blockY++){
			for (int randomBlockType = arc4random()%2;;){
				UIImage* blockImage = [ImageCache loadImage:blockType[randomBlockType]];
				block[blockX][blockY] = [[[UIImage alloc] initWithImage:blockImage] autorelease];
				CGPoint blockPosition = CGPointMake(island.center.x + (256 * blockX), island.center.x + (256 * blockY));
				block[blockX][blockY].center = blockPosition;
				[self.view addSubview:block[blockX][blockY]];
			}
		}
	}
}
Here are the declarations of anything not there:
Code:
// The following variables are declared in the header file like this;

UIImageView* block[10][10];
NSString* blockType[3];

//The following variables are declared in the .m like this;

@synthesize island;

-(void)dealloc {
    [island dealloc];

blockType[0] = @"1.png";
blockType[1] = @"2.png";
blockType[2] = @"";
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 10:36 AM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

1. dealloc should only ever be preceded by the word super.

2. C arrays don't do any memory management like NSArrays do. You are autoreleasing your UIImages. Since the array doesn't keep them alive, they die, and the array continues to point at the dead objects. I'm also guessing that you typed something wrong, and actually mean UIImageView. It is very import to copy-paste the code you are having trouble with.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-30-2010, 10:54 AM   #3 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
1. dealloc should only ever be preceded by the word super.
So by this you mean with only [super dealloc] I'll be fine? I won't have to dealloc everything I synthesize one by one? This does it all for me?

Quote:
Originally Posted by BrianSlick View Post
2. C arrays don't do any memory management like NSArrays do. You are autoreleasing your UIImages. Since the array doesn't keep them alive, they die, and the array continues to point at the dead objects. I'm also guessing that you typed something wrong, and actually mean UIImageView. It is very import to copy-paste the code you are having trouble with.
I don't fully understand:
  • When to release.
  • The difference between releasing and deallocating.
  • or when exactly to use autorelease.

I'm a newbie.

Also, I'm pretty sure I didn't mistype it. I am creating a UIImage out of a random image, and assigning it to the block[blockX][blockY] UIImageView. Should it be done another way?
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 10:57 AM   #4 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
akac is on a distinguished road
Default

Never call dealloc on an object except for super. Simply NEVER. So much is wrong there

Read this.
Cocoa Samurai: Objective-C Memory Management & Garbage Collection

Then read this.
Loading…

Its really simple, but if you don't get it right, nothing will work right. Its like breathing.
akac is offline   Reply With Quote
Old 12-30-2010, 10:58 AM   #5 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Quote:
Originally Posted by UnretroGamer View Post
So by this you mean with only [super dealloc] I'll be fine? I won't have to dealloc everything I synthesize one by one? This does it all for me?
You have to release the items that you synthesize. Not dealloc.

Quote:
Originally Posted by UnretroGamer View Post
I don't fully understand:
  • When to release.
  • The difference between releasing and deallocating.
  • or when exactly to use autorelease.

I'm a newbie.
This is clear. Do some research on memory management.

Quote:
Originally Posted by UnretroGamer View Post
Also, I'm pretty sure I didn't mistype it. I am creating a UIImage out of a random image, and assigning it to the block[blockX][blockY] UIImageView. Should it be done another way?
Code:
block[blockX][blockY] = [[[UIImage alloc] ...
block[blockX][blockY].center = blockPosition;
[self.view addSubview:block[blockX][blockY]];
block is defined as a UIImage. UIImages do not have a center property. UIImageViews do. And then you are adding block as a subview, which is not something you can do with a UIImage.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-30-2010, 11:12 AM   #6 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Actually just read the second one. There's no garbage collection in iOS and the Memory Management Guide from the second link covers all the topics you need.

As a quick tip, everything you init, retain or copy, you need to explicitly release.
baja_yu is offline   Reply With Quote
Old 12-30-2010, 11:12 AM   #7 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
You have to release the items that you synthesize. Not dealloc.



This is clear. Do some research on memory management.



Code:
block[blockX][blockY] = [[[UIImage alloc] ...
block[blockX][blockY].center = blockPosition;
[self.view addSubview:block[blockX][blockY]];
block is defined as a UIImage. UIImages do not have a center property. UIImageViews do. And then you are adding block as a subview, which is not something you can do with a UIImage.
Alright I'm a bit confused but I updated my code to the following, it still doesn't work but hopefully I fixed what you told me to.

Code:
-(void) generateMap {
	for (int blockX = 0; blockX < 10; blockX++){
		for (int blockY = 0; blockY < 10; blockY++){
			for (int randomBlockType = arc4random()%2;;){
				UIImage* blockImage = [UIImage imageWithContentsOfFile:blockType[randomBlockType]];
				block[blockX][blockY] = [UIImageView initWithImage:blockImage];
				CGPoint blockPosition = CGPointMake(island.center.x + (256 * blockX), island.center.x + (256 * blockY));
				block[blockX][blockY].center = blockPosition;
				[self.view addSubview:block[blockX][blockY]];
			}
		}
	}
}
Also I fixed the dealloc to this:
Code:
-(void)dealloc {
	[player, island release];
	[super dealloc];
}
Hopefully I fixed that corerectly too...
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 11:14 AM   #8 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

I'm going to read that Memory Management Guide right now :P
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 01:50 PM   #9 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Exclamation

Alright so I updated the code. This code is as simple as it gets. When I execute it using an IBAction like this:

Code:
-(void)startGenerating {
	[self generateMap];
}
It doesn't crash, but the Toolbar Item Button I use to execute the IBAction stays darkened after being pressed. Does this mean it's processing, not responding, or do I need to do s'more tweaking?

Here is the code:

Code:
-(void) generateMap {
	for (int blockX = 0; blockX < 10; blockX++){
		for (int blockY = 0; blockY < 10; blockY++){
			for (int randomBlockType = arc4random()%2;;) {
				UIImage* blockImage = [UIImage imageWithContentsOfFile:blockType[randomBlockType]];
				block[blockX][blockY].image = blockImage;
				block[blockX][blockY].tag = randomBlockType;
				
				CGPoint blockPosition = CGPointMake(island.center.x + (256 * blockX), island.center.x + (256 * blockY));
				block[blockX][blockY].center = blockPosition;
				
				[self.view addSubview:block[blockX][blockY]];
			}
		}
	}
}
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 01:53 PM   #10 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

What are you trying to accomplish with this:

Code:
for (int randomBlockType = arc4random()%2;;)
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-30-2010, 02:02 PM   #11 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Again I'm new so don't hesitate to say I'm doing things completely wrong.

I'm hoping that the arc4random() will generate a whole number between 0 and 2. The reason I put it there is because I want the number it generates to be the same for all instances of "randomBlockType" through that loop.

P.S. Turns out the IBAction wasn't executing the code, so I moved the execution to the viewDidLoad but now when I Build and Run I just get a black screen with the status bar.
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 02:22 PM   #12 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

I'm pretty sure that if you drop a log in there, you'll find that you have created an infinite loop. for loop declarations consist of 3 parts: 1) an initial value, 2) a test to determine if the loop should continue, 3) a modification for each iteration. You have removed #2 and #3. There is nothing to make that loop exit.

At a glance, there is no reason for the 3rd loop to be a loop.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-30-2010, 07:07 PM   #13 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

So how would I go about doing what I want to do? Which is for each loop, generate a random block type number, but have the number be the same throughout each loop.

What I want this code to do is loop through 100 UIImageViewss, assign a random image, tag them with a number according to that image, give them a location according to which UIImageView of the array it is, and then add them to the View.
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 07:36 PM   #14 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Just declare the variable exactly like you are, but don't put it inside a for statement.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-30-2010, 07:51 PM   #15 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Question

Quote:
Originally Posted by BrianSlick View Post
Just declare the variable exactly like you are, but don't put it inside a for statement.
Won't randomBlockType generate a different number every time it is asked for one though? I want it to be a random number each loop, but throughout each loop to be the same number.

P.S. This code doesn't do anything:

Code:
-(void) generateMap {
	for (int blockX = 0; blockX < 10; blockX++){
		for (int blockY = 0; blockY < 10; blockY++){
			int randomBlockType = arc4random()%2;
			UIImage* blockImage = [UIImage imageWithContentsOfFile:blockType[randomBlockType]];
			block[blockX][blockY].image = blockImage;
			block[blockX][blockY].tag = randomBlockType;
			
			CGPoint blockPosition = CGPointMake(island.center.x + (256 * blockX), island.center.x + (256 * blockY));
			block[blockX][blockY].center = blockPosition;
			
			[self.view addSubview:block[blockX][blockY]];
		}
	}
}
The only error in my entire project is when I initiate generateMap like this:

Code:
-(void)viewDidLoad{
     ...
     [self generateMap];
     ...
}
The warning says: '{Name of my view controller}' may not respond to '-generateMap'

So now I'm guessing the code is correct and I'm just not initiating it correctly. How would I initiate it? Why can't I do it this way?
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 07:52 PM   #16 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

By the way, thanks again for your time and all the help you're providing me with.
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 07:53 PM   #17 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Debug your app, test the values...

put a: NSLog(@"%d", randomBlockType); after this: int randomBlockType = arc4random()%2; and see what the output is in the console.
baja_yu is offline   Reply With Quote
Old 12-30-2010, 07:59 PM   #18 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

You are really hard to follow.

You have an X loop, and you have a Y loop. Which one should have a random number for each pass?

You don't seem to be creating image views anymore, which would explain why you aren't seeing anything.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-30-2010, 08:09 PM   #19 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
You are really hard to follow.

You have an X loop, and you have a Y loop. Which one should have a random number for each pass?

You don't seem to be creating image views anymore, which would explain why you aren't seeing anything.
The reason I have an X loop and Y loop is because I want to make 100 ImageViews in total. I separated them so that I can position them on a grid system. block[0][0] should be on the topLeft, block [9][0] - top right, block [0][9] on the bottom left and block [9][9] should end up being on the bottom right.
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 08:13 PM   #20 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Debug your app, test the values...

put a: NSLog(@"%d", randomBlockType); after this: int randomBlockType = arc4random()%2; and see what the output is in the console.
Alright I added the NSLog but where the ---- is the console. XD
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 08:18 PM   #21 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

menu Run > Console. Or Shift+Cmd+R.
baja_yu is offline   Reply With Quote
Old 12-30-2010, 08:18 PM   #22 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Here is my block of code with comments to run you through what I designed it to do:

Code:
-(void) generateMap {
	for (int blockX = 0; blockX < 10; blockX++){
		for (int blockY = 0; blockY < 10; blockY++){
			int randomBlockType = arc4random()%2; //generate a random number from 0-2
			NSLog(@"%d", randomBlockType); //where's the console window???
			UIImage* blockImage = [UIImage imageWithContentsOfFile:blockType[randomBlockType]]; //create a UIImage out of one of three possible images
			block[blockX][blockY] = [[UIImageView alloc] initWithImage: blockImage]; //assign the image to one of the UIImageViews I declared in the .h
			block[blockX][blockY].tag = randomBlockType; //tag the UIImageView according to the blockType for later use
			
			CGRect blockFrame = block[blockX][blockY].frame; //create a frame
			blockFrame.origin =  CGPointMake(island.center.x + (128 * blockX), island.center.x + (128 * blockY)); //assign the frame the desired coordinates of this UIImageView
			block[blockX][blockY].frame = blockFrame; //assign the UIImageView the properties of the blockFrame I made
			
			[self.view addSubview:block[blockX][blockY]]; //add the UIImageView to the view
		}
	}
}
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 08:22 PM   #23 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Thumbs up

Quote:
Originally Posted by baja_yu View Post
menu Run > Console. Or Shift+Cmd+R.
Thanks for that, that's good to know.

Yes, its generating 100 numbers. (I had to change arc4random()%2 to arc4random()%3 to generate an number 0, 1 or 2 as I wanted)

This also means BrianSlick was correct, and the random number is the same though out the loop but on each loop it generates a different number.
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 08:28 PM   #24 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

I thought I should note that this code:

Code:
-(void) generateMap {
	for (int blockX = 0; blockX < 10; blockX++){
		for (int blockY = 0; blockY < 10; blockY++){
			int randomBlockType = arc4random()%3; //generate a random number from 0-2
			NSLog(@"%d", randomBlockType);
			UIImage* blockImage = [UIImage imageWithContentsOfFile:blockType[randomBlockType]]; //create a UIImage out of one of three possible images
			block[blockX][blockY] = [[UIImageView alloc] initWithImage: blockImage]; //assign the image to one of the UIImageViews I declared in the .h
			block[blockX][blockY].tag = randomBlockType; //tag the UIImageView according to the blockType for later use
			
			CGRect blockFrame = block[blockX][blockY].frame; //create a frame
			blockFrame.origin =  CGPointMake(island.center.x + (128 * blockX), island.center.x + (128 * blockY)); //assign the frame the desired coordinates of this UIImageView
			block[blockX][blockY].frame = blockFrame; //assign the UIImageView the properties of the blockFrame I made
			
			[self.view addSubview:block[blockX][blockY]]; //add the UIImageView to the view
			NSLog(@"Loop [%d][%d] finished", blockX, blockY);
		}
	}
}
generates the following in my Log:

[Session started at 2010-12-30 22:24:47 -0400.]
2010-12-30 22:24:48.736 Primal[11898:207] 2
2010-12-30 22:24:48.737 Primal[11898:207] Loop [0][0] finished
2010-12-30 22:24:48.737 Primal[11898:207] 1
2010-12-30 22:24:48.737 Primal[11898:207] Loop [0][1] finished
2010-12-30 22:24:48.738 Primal[11898:207] 1
2010-12-30 22:24:48.738 Primal[11898:207] Loop [0][2] finished
2010-12-30 22:24:48.738 Primal[11898:207] 1
2010-12-30 22:24:48.739 Primal[11898:207] Loop [0][3] finished
2010-12-30 22:24:48.739 Primal[11898:207] 1
2010-12-30 22:24:48.739 Primal[11898:207] Loop [0][4] finished
2010-12-30 22:24:48.739 Primal[11898:207] 0
2010-12-30 22:24:48.740 Primal[11898:207] Loop [0][5] finished
2010-12-30 22:24:48.740 Primal[11898:207] 1
2010-12-30 22:24:48.740 Primal[11898:207] Loop [0][6] finished
2010-12-30 22:24:48.741 Primal[11898:207] 1
2010-12-30 22:24:48.741 Primal[11898:207] Loop [0][7] finished
2010-12-30 22:24:48.741 Primal[11898:207] 0
2010-12-30 22:24:48.741 Primal[11898:207] Loop [0][8] finished
2010-12-30 22:24:48.742 Primal[11898:207] 0
2010-12-30 22:24:48.742 Primal[11898:207] Loop [0][9] finished
2010-12-30 22:24:48.742 Primal[11898:207] 0
2010-12-30 22:24:48.742 Primal[11898:207] Loop [1][0] finished
2010-12-30 22:24:48.743 Primal[11898:207] 2
2010-12-30 22:24:48.743 Primal[11898:207] Loop [1][1] finished
2010-12-30 22:24:48.743 Primal[11898:207] 1
2010-12-30 22:24:48.743 Primal[11898:207] Loop [1][2] finished
2010-12-30 22:24:48.744 Primal[11898:207] 0
2010-12-30 22:24:48.744 Primal[11898:207] Loop [1][3] finished
2010-12-30 22:24:48.744 Primal[11898:207] 1
2010-12-30 22:24:48.744 Primal[11898:207] Loop [1][4] finished
2010-12-30 22:24:48.745 Primal[11898:207] 1
2010-12-30 22:24:48.745 Primal[11898:207] Loop [1][5] finished
2010-12-30 22:24:48.745 Primal[11898:207] 1
2010-12-30 22:24:48.746 Primal[11898:207] Loop [1][6] finished
2010-12-30 22:24:48.746 Primal[11898:207] 1
2010-12-30 22:24:48.746 Primal[11898:207] Loop [1][7] finished
2010-12-30 22:24:48.746 Primal[11898:207] 2
2010-12-30 22:24:48.747 Primal[11898:207] Loop [1][8] finished
2010-12-30 22:24:48.747 Primal[11898:207] 0
2010-12-30 22:24:48.747 Primal[11898:207] Loop [1][9] finished
2010-12-30 22:24:48.747 Primal[11898:207] 1
2010-12-30 22:24:48.748 Primal[11898:207] Loop [2][0] finished
2010-12-30 22:24:48.748 Primal[11898:207] 0
2010-12-30 22:24:48.748 Primal[11898:207] Loop [2][1] finished
2010-12-30 22:24:48.748 Primal[11898:207] 1
2010-12-30 22:24:48.749 Primal[11898:207] Loop [2][2] finished
2010-12-30 22:24:48.749 Primal[11898:207] 2
2010-12-30 22:24:48.749 Primal[11898:207] Loop [2][3] finished
2010-12-30 22:24:48.750 Primal[11898:207] 2
2010-12-30 22:24:48.750 Primal[11898:207] Loop [2][4] finished
2010-12-30 22:24:48.750 Primal[11898:207] 1
2010-12-30 22:24:48.751 Primal[11898:207] Loop [2][5] finished
2010-12-30 22:24:48.751 Primal[11898:207] 0
2010-12-30 22:24:48.751 Primal[11898:207] Loop [2][6] finished
2010-12-30 22:24:48.752 Primal[11898:207] 2
2010-12-30 22:24:48.752 Primal[11898:207] Loop [2][7] finished
2010-12-30 22:24:48.752 Primal[11898:207] 0
2010-12-30 22:24:48.753 Primal[11898:207] Loop [2][8] finished
2010-12-30 22:24:48.753 Primal[11898:207] 1
2010-12-30 22:24:48.753 Primal[11898:207] Loop [2][9] finished
2010-12-30 22:24:48.753 Primal[11898:207] 2
2010-12-30 22:24:48.754 Primal[11898:207] Loop [3][0] finished
2010-12-30 22:24:48.754 Primal[11898:207] 2
2010-12-30 22:24:48.754 Primal[11898:207] Loop [3][1] finished
2010-12-30 22:24:48.755 Primal[11898:207] 0
2010-12-30 22:24:48.755 Primal[11898:207] Loop [3][2] finished

{I had to cut some, the post was too long}

2010-12-30 22:24:48.782 Primal[11898:207] 0
2010-12-30 22:24:48.782 Primal[11898:207] Loop [8][4] finished
2010-12-30 22:24:48.782 Primal[11898:207] 1
2010-12-30 22:24:48.783 Primal[11898:207] Loop [8][5] finished
2010-12-30 22:24:48.783 Primal[11898:207] 2
2010-12-30 22:24:48.783 Primal[11898:207] Loop [8][6] finished
2010-12-30 22:24:48.784 Primal[11898:207] 1
2010-12-30 22:24:48.784 Primal[11898:207] Loop [8][7] finished
2010-12-30 22:24:48.784 Primal[11898:207] 1
2010-12-30 22:24:48.784 Primal[11898:207] Loop [8][8] finished
2010-12-30 22:24:48.785 Primal[11898:207] 1
2010-12-30 22:24:48.785 Primal[11898:207] Loop [8][9] finished
2010-12-30 22:24:48.785 Primal[11898:207] 1
2010-12-30 22:24:48.785 Primal[11898:207] Loop [9][0] finished
2010-12-30 22:24:48.786 Primal[11898:207] 2
2010-12-30 22:24:48.786 Primal[11898:207] Loop [9][1] finished
2010-12-30 22:24:48.786 Primal[11898:207] 0
2010-12-30 22:24:48.787 Primal[11898:207] Loop [9][2] finished
2010-12-30 22:24:48.787 Primal[11898:207] 0
2010-12-30 22:24:48.787 Primal[11898:207] Loop [9][3] finished
2010-12-30 22:24:48.787 Primal[11898:207] 2
2010-12-30 22:24:48.788 Primal[11898:207] Loop [9][4] finished
2010-12-30 22:24:48.788 Primal[11898:207] 2
2010-12-30 22:24:48.788 Primal[11898:207] Loop [9][5] finished
2010-12-30 22:24:48.788 Primal[11898:207] 0
2010-12-30 22:24:48.789 Primal[11898:207] Loop [9][6] finished
2010-12-30 22:24:48.789 Primal[11898:207] 0
2010-12-30 22:24:48.789 Primal[11898:207] Loop [9][7] finished
2010-12-30 22:24:48.789 Primal[11898:207] 1
2010-12-30 22:24:48.790 Primal[11898:207] Loop [9][8] finished
2010-12-30 22:24:48.790 Primal[11898:207] 0
2010-12-30 22:24:48.790 Primal[11898:207] Loop [9][9] finished


I'm guessing that could help you guys help me find out whats wrong with the code.

What I see when I build and run the code is just what I created in the Interface Builder, I don't see the 100 UIImageViews. NO crashing though, so that's gotta be good.

Last edited by UnretroGamer; 12-30-2010 at 08:31 PM. Reason: shortened it s'more
UnretroGamer is offline   Reply With Quote
Old 12-30-2010, 08:34 PM   #25 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

You probably aren't getting an image. Try using imageNamed: instead of the file one. I think that one needs a path.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Reply

Bookmarks

Tags
arc4random(), cgpoint, crash, uiimage

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 362
9 members and 353 guests
akphyo, blueorb, fredidf, iAppDeveloper, iGamesDev, Kirkout, MarkC, mottdog, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:28 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0