Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure if all the code you posted is from the same version, but if you threw that together I'd see at least the following problem:</p> <p>You say</p> <pre><code>[event setCalendar:calendararray]; </code></pre> <p>doesn't work.</p> <p>It seems <code>calendararray</code> ist set in <code>eventview.m</code>'s <code>calendararray:</code> method.</p> <p>This in turn is called from <code>calendar.m</code>'s <code>pickerView:didSelectRow:</code>, where it takes the selected object from <code>arrayColors</code>.</p> <p>In <code>calendar.m</code>'s <code>viewDidLoad</code> method, <code>arrayColors</code> is initialised with the users's calendars' titles, not the calendars. So you end up giving <code>EKEvent</code>'s <code>setCalendar:</code> method an <code>NSString</code> instead of an <code>EKCalendar</code>.</p> <p>Not knowing the rest of your program, as a fix I would try to keep the <code>EKCalendar</code> objects themselves in <code>arrayColors</code>.</p> <p>So, in <code>calendar.m</code> try to change the</p> <pre><code> [arrayColors addObject:thisCalendar.title]; </code></pre> <p>in <code>viewDidLoad</code> to</p> <pre><code> [arrayColors addObject:thisCalendar]; </code></pre> <p>Then change <code>pickerView:titleForRow:</code> to</p> <pre><code>- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { EKEvent *event = [arrayColors objectAtIndex:row] return event.title; } </code></pre> <p>FInally, in <code>eventview.m</code> change <code>calendararray:</code></p> <pre><code>- (void) calendararray:(EKCalendar *)array{ NSLog(@"calendarNameTextFieldStringFromTable %@", array); calendararray = array; calendarLabel.text = array.title; calendarLabel.textColor = [UIColor brownColor]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload