views:

124

answers:

1

Here goes a newbie question:

  1. Create a new project in Xcode: File > New Project and select Navigation-based Application from iPhone OS templates.

  2. Install json-framework as explained here.

  3. Edit RootViewController.h's interface section into this:

    @interface RootViewController : UITableViewController {
        NSURLRequest *request;
        NSURLConnection *theConnection;
        NSMutableData *receivedData;
        NSArray *faculties;
    }
    
  4. Edit RootViewController.m and implement a couple of simple things. Replace <your_domain_name_goes_here> with a valid domain name where a web service will answer to your calls.

  5. URL above will output a JSON string like this.

  6. Now, if you build&run this code, in debugger console you'll get:

    Attaching to process 35594.
    2010-07-19 13:15:31.307 WSMobileTest[35594:207] Succeeded! Received 580 bytes of data
    Program received signal:  “EXC_BAD_ACCESS”.
    

Any ideas?

Developer Information:

Version:        3.2 (10M2262)
Location:       /Developer
Applications:
    Xcode:              3.2.3 (1688)
    Interface Builder:  3.2.3 (788)
    Instruments:        2.7 (2529)
    Dashcode:           3.0.1 (330)
SDKs:
    Mac OS X:
        10.5:   (9L31a)
        10.6:   (10M2262)
    iPhone OS:
        3.2:    (7B367)
        4.0:    (8A293)
    iPhone Simulator:
        3.2:    (7W367a)
        4.0:    (8A293)
+1  A: 

Congratulations: You've included everything except the line that causes the crash. Set a breakpoint and step through the debugger until it crashes, or look at the backtrace, or something.

In this case, I think you mean faculties = [[jsonString JSONValue] retain;.

tc.
Hey, unfortunately I cannot make the app crash via debugger, but it won't step over and hang on line 146 in RootViewController.m, just as I did reply to Frank in reply to his comment to my original post.As for "retain", due to my ignorance on Objective-C programming in general and iPhone programming in particular, I wasn't aware of what was going on. Thanks for your tip, I won't loose faculties variable therefore code will work without issues.
exalted