Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1107901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:00:08+00:00 2026-05-17T02:00:08+00:00

while creating a library that will be used on several projects, I encountered an

  • 0

while creating a library that will be used on several projects, I encountered an error that I was not able to resolve by myself.

The library is composed of several “modules” that each declares its set of classes. The modules declares a header file that references the classes. Each module header is included in the library header, and all of them are copied to the library target.

The “GMData” module defines the ORM layer of the library, it declares a “GMInitializerBase” class, its purpose is to initialize the module. It must be called once in the UIApplicationDelegate.

The “GMModel” module contains the base model for the application (Categories, Articles, …), It must register itself to “GMData” in order to function properly.

Structure:

<Library Root>
    Library.h
    <GMData>
        GMData.h
        GMInitializerBase.{h,m}
    <GMModel>
        GMModel.h
        GMInitializerBase+GMModel.{h,m}

Contents of Library.h

#import "GMData.h"
#import "GMModel.h"

Contents of GMData.h

#import "... ORM related headers ..."
#import "GMInitializerBase.h"

Contents of GMInitializerBase.{h,m}

#import "... ORM Classes ..."

@interface GMInitializerBase : NSObject {

}

+ (void) bootstrap;
+ (GMInitializerBase*) initializer; // autoreleased instance creator

- (void) setup;
- (void) setupStore:(GMManagerFactory*)factory; // Setup database connection
- (void) setupHelpers:(GMHelperFactory*)factory; // Register helpers (abstract)
- (void) setupManagers:(GMManagerFactory*)factory; // Register managers (abstract)

@end

@implementation GMInitializerBase

+ (void) bootstrap {
    GMInitializerBase* initializer = [self initializer];

    [initializer setup];
}

- (void) setup {
    /* Breakpoint 01 */
    GMHelperFactory* helperFactory = [GMHelperFactory sharedInstance];
    GMManagerFactory* managerFactory = [GMManagerFactory sharedInstance];

    [self setupStore:managerFactory];
    [self setupHelpers:helperFactory];
    [self setupManagers:managerFactory];
}

@end

Contents of GMModel.h

#import "... Base Models files ..."
#import "GMInitializerBase+GMModel.h"

Contents of GMInitializerBase+GMModel.{h,m}

@interface GMInitializerBase (GMModel_Additions)

- (void) setup;
- (void) setupGMModelHelpers:(GMHelperFactory*)factory;
- (void) setupGMModelManagers:(GMManagerFactory*)factory;

@end

@implementation GMInitializerBase (GMModel_Additions)

- (void) setup {
    /* Breakpoint 02 */
    GMHelperFactory* helperFactory = [GMHelperFactory sharedInstance];
    GMManagerFactory* managerFactory = [GMManagerFactory sharedInstance];

    // parent implementation
    [self setupStore:managerFactory];

    // current implementation
    [self setupGMModelHelpers:helperFactory];
    [self setupGMModelManagers:managerFactory];

    // parent implementation
    [self setupHelpers:helperFactory];
    [self setupManagers:managerFactory];
}

- (void) setupGMModelHelpers:(GMHelperFactory*)factory { /* ... */ }
- (void) setupGMModelManagers:(GMManagerFactory*)factory { /* ... */ }

@end

Contents of ProjectAppDelegate.m (located in another project, it includes the library.a and search the “Headers” directory)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[GMInitializerBase initializer] setup];
}

Stops at the first breakpoint (Breakpoint 01)
It crashed when in the library:

  • I declare an addition without overloading a method;
  • I declare an addition to a Cocoa class ([NSString toto]) without overloading;

In works when in the test project:

  • I declare an addition to a Cocoa class ([NSString toto]) without overloading;

I didn’t try to overload a library class but I assume it will work too.

My problem is the following: I can’t get the addition workingm and I need it.

Thanks for reading, thanks for answering.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:00:08+00:00Added an answer on May 17, 2026 at 2:00 am

    Make sure you have the -all_load and -ObjC flags set in the “Other Linker Flags” in the project settings. Categories in a library won’t work without them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that
I ran into some trouble while creating a C-Extension for ruby that got me
I am creating a class library for a project management application. I will brief
I need to be able to export PDF's that I am creating to JPEG,
I'm starting to consider creating a class library that I want to make generic
I'm creating a custom powershell 1.0 cmdlet that will allow me to feed exceptions
I am creating a networking library in C# that I can use in any
I am working on creating and linking shared library (.so). While working with them,
I'm creating an app, that is in some point turning photo library on. The
I am creating a little Math library for myself contained within a single project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.