Problem when migrate iPhone app to iPad device

Discussion in 'iOS Programming' started by utklyf, Apr 9, 2010.

  1. utklyf macrumors newbie

    Joined:
    Dec 12, 2009
    #1
    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;
    }
    
    
     
  2. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #2
    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?
     
  3. utklyf thread starter macrumors newbie

    Joined:
    Dec 12, 2009
    #3
    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
    
    
     

    Attached Files:

  4. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #4
    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.
     

Share This Page