So I'm working with a This code works fine as far as I can tell. The does not return the correct email here only; it just freeze the program and gives me a threading error that is If I change this code then it works fine. After this, both the Please help me understand this problem if you need more information. Just ask Edit Here is the start of my ViewController.h file. See here where the email has been declared in ViewController.h. The error I see like this. You must not declare as pickerview and string for one of the many things I need to have a
array stored in the code for the
pickerview code code looks like this.
- (zero) picker view: (UIPRView *) PickWarze did select: Compound in line (NSINTEGER) component {switch (line) {Case 0: image .image = image1; Email = email array [1]; break; Case 1: image.image = image2; Email = EmailArray [3]; break; Case 2: image.image = image3; Email = email order [5]; break; } NSLog (@ "% @", email)}
NSLog gives the correct email every time here, the user then presses a button that uses the "email" string. Here is the first part of that code.
- (IBAction) sendFeedback: (ID) sender {NSLog (@ "% @", email); }
NSLog Indicates that I am not passing the array in the string correctly?
switch (line) {case 0: image.image = image1; Email = @ "testEmail@gmail.com"; break;
NSLogs test will display the email
@interface ViewController: UIViewController & lt; UIPickerViewDataSource, UIPickerViewDelegate, UIImagePickerControllerDelegate & gt; {NSMutableArray * EmailArray; }
@implementation ViewController NSString * email;
thread 1: EXC_BAD_ACCESS (code = 2, address = 0x14)
email as a code; a
NSString should be declared as a property with a copy modifier
@property (copy, nonatomic) NSString * Email;
No comments:
Post a Comment