2013-12-15 2 views
0

:텍스트 뷰 텍스트 추가 내 문제입니다

Document.h

: 지금은 코드입니다, 내가 this처럼, 계산기를 구축하고 싶습니다, 그래서 텍스트 뷰와 윈도우의 일부 버튼을 넣어하지만,
// 
// Document.m 
// TheCalcolator 
// 
// Created by Imac on 15/12/13. 
// Copyright (c) 2013 Imac. All rights reserved. 
// 

#import "Document.h" 
#import "FunctionalManager.h" 

@implementation Document 

- (id)init 
{ 
    self = [super init]; 
    if (self) { 
     // Add your subclass-specific initialization here. 
    } 
    return self; 
} 

- (NSString *)windowNibName 
{ 
    // Override returning the nib file name of the document 
    // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. 
    return @"Document"; 
} 

- (void)windowControllerDidLoadNib:(NSWindowController *)aController 
{ 
    [super windowControllerDidLoadNib:aController]; 
    // Add any code here that needs to be executed once the windowController has loaded the document's window. 
} 

+ (BOOL)autosavesInPlace 
{ 
    return YES; 
} 

- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError 
{ 
    // Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil. 
    // You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead. 
    NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil]; 
    @throw exception; 
    return nil; 
} 

- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError 
{ 
    // Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO. 
    // You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead. 
    // If you override either of these, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded. 
    NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil]; 
    @throw exception; 
    return YES; 
} 

-(IBAction)aggiungiuno:(id)sender 
{ 
    FunctionalManager *func = [[FunctionalManager init] alloc]; 

    [func aggiungitesto:@"1" allaView:textView]; 
} 

@end 

및 그 FunctionalManager.m의 : 오류가 어디

// 
// FunctionalManager.m 
// TheCalcolator 
// 
// Created by Imac on 15/12/13. 
// Copyright (c) 2013 Imac. All rights reserved. 
// 

#import "FunctionalManager.h" 

@implementation FunctionalManager 

-(void)aggiungitesto:(NSString *)daString allaView:(NSTextView *)view 
{ 
    NSString *testoAttuale = view.string; 

    view.string = [NSString stringWithFormat:@"%@%@", testoAttuale, daString]; 

} 

@end 

당신이 나를 이해하는 데 도움이 할 수있어? 내가 빌드 할 때 때문에 그 엑스 코드 나 표시 내용은 다음과 같습니다 당신은 뒤로 alloc/init있어

FunctionalManager *func = [[FunctionalManager alloc] init]; 

: 당신이 필요 http://it.tinypic.com/r/2z9d6qd/5

답변