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

The Archive Base Latest Questions

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

#import Mutation.h //my class @implementation NTAppDelegate using app delegate as controller @synthesize window =

  • 0
#import "Mutation.h" //my class

@implementation NTAppDelegate

using app delegate as controller

@synthesize window = _window;
@synthesize dataField = _dataField;
@synthesize OutputField = _OutputField;

@synthesize mutation;

why not _mutation?

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
Mutation *aMutation = [[Mutation alloc] init];
[self setMutation:aMutation];
[self.mutation setInputString:@"new"];
[self.mutation setOutputString:@"old"];
NSLog(@"Mutation inputString is %@; outputString is %@",[mutation inputString],[mutation outputString]);
}

getUserText is supposed to take a text field entry string and stick it into an ivar in my mutation object…

- (IBAction)getUserText:(NSTextField *)sender
{
// assign the users entered text to mutation's inputString
NSString* newText = [sender stringValue];

-stringValue inh from NSControl EUREKA!

NSLog (@"%@ was entered", newText);

THE ABOVE WORKS

[mutation setInputString:newText];

THE ABOVE CRASHES, bad sell? can not call mutation.
}

  • 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-30T01:52:21+00:00Added an answer on May 30, 2026 at 1:52 am

    I can tell you the _mutation is purely a matter of preference. Instead of the property creating an instance variable named mutation it creates one named _mutation. This is helpful when you want to distinguish instance variables from locally generated variables (you don’t have to write self.mutation, because it is an instance variable it is inferred)

    In objective c when you @synthesize things you can name the instance variable anything. So you could write:
    @synthesize mutation = thisIsMyMutation;

    As to why your code is crashing, I think it is because you retain the property when you declare it so that it is strongly typed. Don’t remove the retain from the declaration, because the object should be retained. Instead, rewrite your code so that you allocate memory for the property before you use it.

    self.mutation = [[Mutation alloc] init];
    [self.mutation setInputString:@"new"];
    [self.mutation setOutputString:@"old"];
    

    SUMMARY: I believe your problem lies in the fact that you don’t allocate memory for the property. This is normally done in the init function. Because your in the app delegate if you do it in the didFinishLaunching it should work just fine.

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

Sidebar

Related Questions

import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.RelativeLayout; public class
import java.lang.Math; public class NewtonIteration { public static void main(String[] args) { System.out.print(rootNofX(2,9)); }
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DateDemo { public static void main(String[]
import java.io.*; import java.util.Scanner; import java.util.StringTokenizer; public class Filereader { public static void main(String[]
import wx class MainFrame(wx.Frame): def __init__(self,parent,title): wx.Frame.__init__(self, parent, title=title, size=(640,480)) self.mainPanel=DoubleBufferTest(self,-1) self.Show(True) class DoubleBufferTest(wx.Panel):
import java.lang.reflect.Array; public class PrimitiveArrayGeneric { static <T> T[] genericArrayNewInstance(Class<T> componentType) { return (T[])
import inspect class Test: def test(self, p, d={}): d.update(p) return d print inspect.getargspec(getattr(Test, 'test'))[3]
import javax.swing.*; import java.io.File; public class Third { public static void main(String[] args) throws
import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; public class Main implements Runnable { private final CountDownLatch cdl1
#import Three20/Three20.h Fails. Go download it and build a sample app. If that works,

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.