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

  • Home
  • SEARCH
  • 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 7580251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:52:13+00:00 2026-05-30T17:52:13+00:00

I’m using the static code analyser in objective C and I found that using

  • 0

I’m using the static code analyser in objective C and I found that using categories to spread a big file in multiple files causes the following problem:

@interface TestClass : UIViewController
@property (nonatomic, assign) UITableView* myTableView;
@end

@implementation TestClass
@end

@interface TestClass (someCategory)
@end

@implementation TestClass (someCategory)
- (void) someMethod
{
    // ...
    CGRect tableViewRect = 
       CGRectMake( sectionRect.origin.x,
                   sectionRect.origin.y + sectionRect.size.height + 1.0,
                   sectionRect.size.width,
                   tableViewHeight);
    myTableView = [[UITableView alloc] initWithFrame:(CGRect) tableViewRect
                             style:(UITableViewStyle) UITableViewStylePlain];
   [self.view addSubView: (UIView*) myTableView];
   [myTableView release];
}
@end

Problem # 1: Compiling TestClass(someCategory) gives me an error “use of undeclared identifier ‘theArray'”.
-> Adding the prefix “self.myTableView” seems to fix the problem.

Problem # 2: Once I have added the “self.” prefix before “myTableView”, the code analyser complains “incorrect decrement of the reference count of an object that is not owned at this point by the caller”
->I have seen this before in my code: easy to fix by removing the “self.” prefix in other, non categorized classes.

So I have a catch 22 situation!
– I can’t have a class category without prefixing the properties that I use with “self.”
– The code analyser gives me warnings because it does not seem to understand that my category owns an object that it allocates and frees.

Fixing either of these two problems would work for me
(a) finding a way to avoid specifying the “.self” prefix when referencing an attribute from my category implementation
(b) finding a way to make the code analyser happy with the fact that I own “self.xxx” where “xxx” is a property of the class that I am categorizing.

  • 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-30T17:52:14+00:00Added an answer on May 30, 2026 at 5:52 pm

    If you need to hold a reference to your table view for the life of the object, you should release it in the dealloc method. Saying [object release] is effectively saying you don’t need a reference to the object any more.

    If you don’t need a reference to the table view, there’s no need to use an instance variable/property. Just set up a temporary UITableView * pointer in your method.

    Releasing an object from a property getter is usually a bad idea (see this question: Incorrect decrement of the reference count of an object that is not owned at this point by the caller)

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.