I am trying to make a universal framework for iOS by following steps
specified in this URL:
http://blog.db-in.com/universal-framework-for-ios/

I have a view controller class within that framework which internally
loads a xib file.
Below is a part of code which shows how I am initializing that view
controller and showing related view:

    /*** Part of implementation of SomeViewController class, which is
outside the framework ***/

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

        self.viewControllerWithinFramework =
[[ViewControllerWithinFramework alloc] initWithTitle:@"My custom
view"];
    }
    - (IBAction)showSomeView:(id)sender {
        [self.viewControllerWithinFramework showRelatedView];
    }

    /*** Part of implementation of ViewControllerWithinFramework
class, which is inside the framework ***/

    - (id)initWithTitle:(NSString *)aTitle
    {
       self = [super initWithNibName:@"ViewControllerWithinFramework"
bundle:nil]; // ViewControllerWithinFramework.xib is within the
framework

       if (self)
       {
           _viewControllerTitle = aTitle;
       }

       return self;
    }

While creating the framework, I included all xibs, including
ViewControllerWithinFramework.xib within its 'Copy Bundle Resources'
build phase.

Now my problem is when I try to integrate that framework within other
project, it crashes with below stack trace:

    Sample[3616:a0b] *** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Could not load NIB in
bundle: 'NSBundle </Users/miraaj/Library/Application Support/iPhone
Simulator/7.0/Applications/78CB9BC5-0FCE-40FC-8BCB-721EBA031296/Sample.app>
(loaded)' with name 'ViewControllerWithinFramework''
    *** First throw call stack:
    (
    0   CoreFoundation                      0x017365e4
__exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x014b98b6 objc_exception_throw + 44
    2   CoreFoundation                      0x017363bb +[NSException
raise:format:] + 139
    3   UIKit                               0x004cc65c -[UINib
instantiateWithOwner:options:] + 951
    4   UIKit                               0x0033ec95
-[UIViewController _loadViewFromNibNamed:bundle:] + 280
    5   UIKit                               0x0033f43d
-[UIViewController loadView] + 302
    6   UIKit                               0x0033f73e
-[UIViewController loadViewIfRequired] + 78
    7   UIKit                               0x0033fc44
-[UIViewController view] + 35

Any ideas, how could I resolve this problem?

*Note: It works fine if there is no any xib within the framework.*
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to