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 6730071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:21:52+00:00 2026-05-26T10:21:52+00:00

I included a header in my prefix.pch file as so: #import <Availability.h> #ifndef __IPHONE_3_0

  • 0

I included a header in my prefix.pch file as so:

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif 

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import "Constants.h"
#endif

And in the included header is a class extensions:

@interface UIColor (MyApp)

+(UIColor *) myColor;
+(UIColor *) navColor;

@end

@implementation UIColor (MyApp)

+(UIColor *) myColor { return [UIColor colorWithRed:0 green:0.3 blue:0.7 alpha:1.0]; }
+(UIColor *) navColor { return [UIColor colorWithRed:0.3 green:0.1 blue:0.2 alpha:1.0]; }

@end

Which I then called in other files as such:

[self.theTable setSeparatorColor:[UIColor myColor]];

But since upgrading to xCode 4.2 / iOS 5 it now causes a crash, saying "Thread 1: Program received signal: "SIGABRT". at the above line.

This happens whenever I try and reference the color regardless of which file and what context. I did not have this problem when working on iOS 4.

Is there a better was to extend a class in a way that is available to all files, or to fix the above error?

Many thanks,

Tim

  • 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-26T10:21:53+00:00Added an answer on May 26, 2026 at 10:21 am

    Your declarations should be in a header:

    @interface UIColor (MyApp)
    
    +(UIColor *) myColor;
    +(UIColor *) navColor;
    
    @end
    

    and your definitions should be in your .m:

    @implementation UIColor (MyApp)
    
    +(UIColor *) myColor { return [UIColor colorWithRed:0 green:0.3 blue:0.7 alpha:1.0]; }
    +(UIColor *) navColor { return [UIColor colorWithRed:0.3 green:0.1 blue:0.2 alpha:1.0]; }
    
    @end
    

    that may not necessarily be the reason for your SIGABRT, but your @implementation block should only ever be visible to one translation (surprised it did not give a link error, unless i misunderstood your question).

    Is there any more context to why the program crashed?

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

Sidebar

Related Questions

My first CSV file looks like this with header included (header is included only
Is it just to test compile a simple program, with that header file #included
Can anyone please tell why this error? I have included everything ( all header,
If a header file (.h) included in the source file has also been included
I have a file called header.html and it is included by base.html . In
I have a header file, lets say Common.h, that is included in all of
I want to include a header file only if a certain function body is
/Users/madhukar/Desktop/wishstix/Classes/wishstixAppDelegate.h:11:0 /Users/madhukar/Desktop/wishstix/Classes/wishstixAppDelegate.h:11:32: error: FBConnect/FBSession.h: No such file or directory /Users/madhukar/Desktop/wishstix/wishstix_Prefix.pch:13:0 In file included from
My PHP site has header,body,footer files that are included into the INDEX.PHP page. On
I have an alertview which displays fine. In my header I've included the UIAlertViewDelegate,

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.