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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:24:53+00:00 2026-05-24T23:24:53+00:00

I’ve consulted a similar thread to the following code that I have so far.

  • 0

I’ve consulted a similar thread to the following code that I have so far. Unfortunately, this doesn’t work as planned. The following code produces no error/warning but will do nothing. I want the IBOutlet class level because it will be used in a class level method as stated below.

#import <Foundation/Foundation.h>

@interface Interface : NSObject <NSApplicationDelegate> {NSTextView* textView;}

@property (nonatomic, retain) IBOutlet NSTextView* textView;

+ (void)NSPrint:(NSString*)aString;

@end

meanwhile in Interface.m..

 #import "Interface.h"

@implementation Interface
@synthesize textView;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    [Interface NSPrint:@"Have fun with this program!"];
}
+ (void)NSPrint:(NSString*)aString
{
    [[[[[Interface new] textView] textStorage] mutableString] appendFormat:@"%@\n",aString];
}
  • 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-24T23:24:53+00:00Added an answer on May 24, 2026 at 11:24 pm

    I’m not really sure what you’re doing here. NSPrint creates a instance of Interface, and changes a property of one of its instance variables. Then the method ends.

    What are you expecting to observe from this? You don’t have the instance of Interface created in NSPrint: connected to anything or doing anything- you just create it and leave it floating free. To actually access the instance of Interface created by [Interface new], use something like:

    +(Interface*)NSPrint:(NSString*)aString
    {
          Interface* newInterface = [Interface new];
          [[[[newInterface textView] textStorage] mutableString] appendFormat:@"%@\n",aString];
          return newInterface;
    }
    

    On the subject of IBOutlet: IBOutlet has no meaning except to alert XCode’s interface builder that it should allows you to create connections between a controller object’s variable (marked with IBOutlet) and another object created in the interface builder. Then, when the view is loaded, the controller object’s variable’s setter method is called using the connected object as the argument. You end up with an instance of the controller class with its instance variable set to an object created in the interface Builder.

    For more info on that, look in the Objective-C manual on the Apple website: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html or at the information about interface builder: http://developer.apple.com/library/mac/#recipes/xcode_help-interface_builder/_index.html#//apple_ref/doc/uid/TP40009971

    If you need a class variable (that is, a variable connected to a class and not to a specific instance of that class), you have a problem. Take a look at this question for more on that: Objective C Static Class Level variables

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have this code to decode numeric html entities to the UTF8 equivalent character.
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.