Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 26, 2013, 03:56 AM   #1
Fritzables
macrumors regular
 
Join Date: May 2011
Location: Brisbane AUSTRALIA
Loading then Showing a Xib (XCode4)?

I am having a great deal of difficulty in working out how to load then display a basic Xib.

I have used source file from a book I purchased (Apress: Learn Cocoa on the Mac) and when running this code all does what it is meant to do.

I try and duplicate this myself and for the life of me I can't get it to work and I am sure I have the exact same code - so I am guessing it could be a XCode setting preventing it.

I have attached the code (Demo.zip) id anyone cares to take a look - it is pretty basic so it won't be difficult to follow what I am trying to achieve. Don't worry about the WindowTwo.xib as I can't even get WindowOne to work.

Good Luck.

Fritzables.
Attached Files
File Type: zip Demo.zip (84.6 KB, 15 views)

Last edited by Fritzables; Jan 26, 2013 at 04:41 AM.
Fritzables is offline   0 Reply With Quote
Old Jan 27, 2013, 03:12 PM   #2
Madd the Sane
macrumors 6502
 
Join Date: Nov 2010
Location: Utah
A few comments about your code: the first letter of an Objective C function should be lowercase. Store the window or window controller, otherwise the object will leak (MRC) or get deallocated (GC/ARC).

Now, the reason why your window isn't showing: you're not telling it to display: -showWindow: will do that; -window will just return a pointer to the internal NSWindow object (it will also initialize the outlet pointers and hook up actions to get ready for the NSWindow object.).
Madd the Sane is offline   0 Reply With Quote
Old Jan 29, 2013, 01:10 AM   #3
Fritzables
Thread Starter
macrumors regular
 
Join Date: May 2011
Location: Brisbane AUSTRALIA
G'Day Madd,

Thanks very much for that.

I gotta say, after banging my head around over this code, paying attention to format was not something I was concerned about - but again, no excuses.

Again, thanks for the tip on the code itself.

Fritzables.
Fritzables is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Email(composed in the Mail app & not Saved/Sent) showing a 'Loading...' Message! Help Hannah7992 iPhone Tips, Help and Troubleshooting 0 May 26, 2014 07:15 PM
App Store loading...loading...loading evilrt iPhone Tips, Help and Troubleshooting 0 Sep 22, 2013 08:05 AM
iTunes .m4v files showing up as green before loading starbuck1986 OS X 10.8 Mountain Lion 2 Jul 2, 2013 04:56 PM
Websites not fully loading, taking 20-30 seconds to full load - not loading at all? johnnnw MacBook Pro 9 May 29, 2013 10:36 AM
How to navigate from one xib to an uitableview(without xib) fypj2013 iPhone/iPad Programming 3 Mar 16, 2013 07:23 AM

Forum Jump

All times are GMT -5. The time now is 04:23 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC