Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Mac OS X Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-07-2011, 07:57 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 8
galliva is on a distinguished road
Default core data - tableview selection across 2 windows

Hi,
I have a question regarding core data and selection.

I have followed the "CarLot" example provided in the book "Cocoa Programming for Mac OS X".
Basically I have a Window with table view, the columns of table view are binded to an array controlled, below the table view I have a date picker showing a date based on the selected row on the table view.

What I would to do now, is having the same functionality but with the date picker in another window (i.e.: another XIB and another controller).

As in the other window I would like to also other objects, I need to have the same NSArrayController in two views.

My idea was to create an init function on my second-view controller:

Code:
- (id)initWithArrayController:(NSArrayController *)aController
{
[super init];
controller = aController;
return self;
}
The first question I would like to ask, is this a correct way to proceed in order to have a controlled "shared" in two windows?


The second question is, how can I access an NSArrayController created in IB in my code?

In my .h file I currently have:

Code:
IBOutlet NSArrayController *myArrayController;
I have then bound myArrayController in IB.

And my idea was to do something like:

Code:
- (IBAction)openSecondWindow:(id)sender
{
if (!secondWindow) {
secondWindowController = [[SecondWindowController alloc] initWithArrayController: myArrayController];
}
[secondWindowController showWindow:self];
}
but myArrayController is always NULL.

What am I doing wrong? How can I access an IB drag-and-dropped control in code?

Thanks a lot!
galliva is offline   Reply With Quote
Old 12-27-2011, 01:03 PM   #2 (permalink)
Registered Member
 
Join Date: Mar 2011
Location: Kalkata
Posts: 5
Kapil9845 is on a distinguished road
Default Need Help...

Hello All,

This is regarding the ticket booking website. While creating the website i am anable to create and configure the database please help me to resolve that....Manali Tour Packages
Kapil9845 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 371
10 members and 361 guests
Creativ, Emy, eski, husthlj, illogical, LegionMD, LunarMoon, padsoftware, stanny, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,677
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, husthlj
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0