Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

utklyf

macrumors newbie
Original poster
Dec 12, 2009
6
0
Hi, I was trying to migrate a simple helloworld app from iPhone to iPad. (I have used the 'two device-specific applications' model)

It works well with iPhone simulator 3.2 (the iPad simulator). But after I installed it onto a real iPad device, it just doesn't work. The app cannot get started.

below is my code, thanks a lot

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
	
	[[cell textLabel] setText:@"helloworld"];
	
    return cell;
}
 
Care to post the rest of the code? The crash report? SOMETHING that will help people help you? What you posted may have no impact at all on what your real problem is?
 
Care to post the rest of the code? The crash report? SOMETHING that will help people help you? What you posted may have no impact at all on what your real problem is?

Sure!! The complete class is in follows. I didn't get any crash report. But I have taken 5 pictures of this app. The 1st is what it looks like on iPad simulator, the 2nd - 5th are what it performed on iPad device.

You can see that it works well on simulator, but on iPad device, when I click on it, the icon will fly out and then come back again. But the cells and the words 'hello world' never show up.

Many thanks


Code:
#import "RootViewController.h"

@implementation RootViewController

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release anything that can be recreated in viewDidLoad or on demand.
	// e.g. self.myOutlet = nil;
}


#pragma mark Table view methods

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
	
	
	[[cell textLabel] setText:@"helllworld"];
	// Configure the cell.
	
    return cell;
}



- (void)dealloc {
    [super dealloc];
}


@end
 

Attachments

  • Screen shot 2010-04-09 at 10.29.27 AM.png
    Screen shot 2010-04-09 at 10.29.27 AM.png
    400.4 KB · Views: 81
  • IMG_0002.PNG
    IMG_0002.PNG
    1 MB · Views: 76
  • IMG_0003.PNG
    IMG_0003.PNG
    1,021.1 KB · Views: 122
  • IMG_0004.PNG
    IMG_0004.PNG
    1,020.9 KB · Views: 80
  • IMG_0005.PNG
    IMG_0005.PNG
    1 MB · Views: 96
If it's going right back to the Springboard it is crashing, and there should be a report. When you have your iPad hooked up, go into Organizer and view the crash reports, you should see one for your app.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.