Re: Need help for user interface in COCOA +
Objective C



Hello,

Short answer is "Use the main thread." Nearly all of AppKit is unsafe to use on secondary threads.

Better answer is to read the Thread Programming Guide here:
http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html

Good luck,
Chris Backas


On Mar 31, 2009, at 8:40 AM, Mangesh Kute wrote:

Hi,

I am using COCOA + Objective C for creating user interface for my application.
I created nib for displaying message to user.
When I load this nib from main thread, it works fine.
But when I load it from thread it displays blank white window and
processor get hogged.

For loading nib I am using following code,
NSApp = [NSApplication sharedApplication];
[MacMsgDialog myLoadNib];
[NSApp run];

In awakeFromNib, I am doing

[msgWindow center];
[msgWindow makeKeyAndOrderFront:nil]; // to show it
[msgWindow setLevel:NSFloatingWindowLevel];


Can someone please help me?

Regards,
Mangesh
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/chb%40infoplusonline.com

This email sent to chb@xxxxxxxxxxxxxxxxxx


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

r> Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us

This email sent to maillists@xxxxxxxxx



Privacy