2013-06-08 2 views
0

애플은 뷰와 배경색 만 포함 된 펜촉을로드하는 동안 내 앱이 다운되는 것을 관리합니다. 내 장치에서 충돌이 발생하지 않는 것 같습니다. 그것은 메모리 문제가 될 수 있습니까 아니면 코드에서 바보 같은 일을하고 있습니까?앱 스토어 리뷰에서 크래시를 일으키는 빈 펜촉을로드 중

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Crashed Thread: 0 

Last Exception Backtrace: 
0 CoreFoundation     0x32b0629e __exceptionPreprocess + 158 
1 libobjc.A.dylib     0x3a9aa97a objc_exception_throw + 26 
2 CoreFoundation     0x32b061c0 +[NSException raise:format:] + 100 
3 UIKit       0x34aab56c -[UINib instantiateWithOwner:options:] + 1632 
4 UIKit       0x34aaab96 -[UIViewController _loadViewFromNibNamed:bundle:] + 230 
5 UIKit       0x349a3038 -[UIViewController loadView] + 88 
6 UIKit       0x3492d468 -[UIViewController loadViewIfRequired] + 64 
7 CodeFriend      0x000b3b14 -[ThemesPopOverViewController initWithNibName:bundle:] (ThemesPopOverViewController.m:24) 
8 CodeFriend      0x000b221a -[AppDelegate settingAct:] (AppDelegate.m:127) 

난의 ViewController에서 사용하는 코드 :

#import "ThemesPopOverViewController.h" 

@interface ThemesPopOverViewController() 

@end 

@implementation ThemesPopOverViewController 
@synthesize tableView; 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
{ 
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 
    if (self) { 


     themes = [[NSArray alloc] initWithObjects:kRegexHighlightViewThemeArray]; 
     self.tableView = nil; 
     self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(20, 0, self.view.frame.size.width - 40, 350)]; 
     [self.tableView setBackgroundColor:[UIColor clearColor]]; 
     [self.tableView setDelegate:self]; 
     [self.tableView setDataSource:self]; 
     [self.view addSubview:self.tableView]; 
     int item = [themes indexOfObject:theDelegate.codeView.currentTheme]; 
     NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:0]; 
     [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; 

    } 

    return self; 
} 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    // Do any additional setup after loading the view from its nib. 
} 

- (void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 
    // Dispose of any resources that can be recreated. 
} 


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{ 
    return 1; //count of section 
} 


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
    //NSLog(@"%d",themes.count); 
    return [themes count]; //count number of row from counting array hear cataGorry is An Array 
} 



- (UITableViewCell *)tableView:(UITableView *)tableView 
     cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *MyIdentifier = @"MyIdentifier"; 

    UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:MyIdentifier]; 

    if (cell == nil) 
    { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
             reuseIdentifier:MyIdentifier]; 

     UIView *bgColorView = [[UIView alloc] init]; 
     [bgColorView setBackgroundColor:[UIColor colorWithRed:25/255.0f green:185/255.0f blue:152/255.0f alpha:1.0f]]; 
     [cell setSelectedBackgroundView:bgColorView]; 
    } 
    [cell.textLabel setFont:[UIFont fontWithName:@"Helvetica" size:16]]; 
    cell.textLabel.text = [themes objectAtIndex: indexPath.row]; 
    return cell; 
} 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    NSLog(@"%d", indexPath.row); 
    [theDelegate.codeView setHighlightThemeFromString:[themes objectAtIndex:indexPath.row]]; 
    [theDelegate removePop]; 

} 

@end 

가 H 파일 :

#import <UIKit/UIKit.h> 
#import "AppDelegate.h" 


@interface ThemesPopOverViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>{ 
    NSArray *themes; 
} 
@property (nonatomic, retain) UITableView *tableView; 





@end 

펜촉 :

<?xml version="1.0" encoding="UTF-8"?> 
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00"> 
    <data> 
     <int key="IBDocument.SystemTarget">1552</int> 
     <string key="IBDocument.SystemVersion">12D78</string> 
     <string key="IBDocument.InterfaceBuilderVersion">3084</string> 
     <string key="IBDocument.AppKitVersion">1187.37</string> 
     <string key="IBDocument.HIToolboxVersion">626.00</string> 
     <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> 
      <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 
      <string key="NS.object.0">2083</string> 
     </object> 
     <array key="IBDocument.IntegratedClassDependencies"> 
      <string>IBProxyObject</string> 
      <string>IBUIView</string> 
     </array> 
     <array key="IBDocument.PluginDependencies"> 
      <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 
     </array> 
     <object class="NSMutableDictionary" key="IBDocument.Metadata"> 
      <string key="NS.key.0">PluginDependencyRecalculationVersion</string> 
      <integer value="1" key="NS.object.0"/> 
     </object> 
     <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> 
      <object class="IBProxyObject" id="372490531"> 
       <string key="IBProxiedObjectIdentifier">IBFilesOwner</string> 
       <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> 
      </object> 
      <object class="IBProxyObject" id="975951072"> 
       <string key="IBProxiedObjectIdentifier">IBFirstResponder</string> 
       <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> 
      </object> 
      <object class="IBUIView" id="191373211"> 
       <reference key="NSNextResponder"/> 
       <int key="NSvFlags">274</int> 
       <string key="NSFrame">{{0, 20}, {128, 214}}</string> 
       <reference key="NSSuperview"/> 
       <object class="NSColor" key="IBUIBackgroundColor"> 
        <int key="NSColorSpace">2</int> 
        <bytes key="NSRGB">MC4yNTg4MjM1NDM4IDAuMzYwNzg0MzIyIDAuNDI3NDUxMDE0NQA</bytes> 
       </object> 
       <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> 
       <object class="IBUISimulatedSizeMetrics" key="IBUISimulatedDestinationMetrics"> 
        <string key="IBUISimulatedSizeMetricsClass">IBUISimulatedFreeformSizeMetricsSentinel</string> 
        <string key="IBUIDisplayName">Freeform</string> 
       </object> 
       <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> 
      </object> 
     </array> 
     <object class="IBObjectContainer" key="IBDocument.Objects"> 
      <array class="NSMutableArray" key="connectionRecords"> 
       <object class="IBConnectionRecord"> 
        <object class="IBCocoaTouchOutletConnection" key="connection"> 
         <string key="label">view</string> 
         <reference key="source" ref="372490531"/> 
         <reference key="destination" ref="191373211"/> 
        </object> 
        <int key="connectionID">3</int> 
       </object> 
      </array> 
      <object class="IBMutableOrderedSet" key="objectRecords"> 
       <array key="orderedObjects"> 
        <object class="IBObjectRecord"> 
         <int key="objectID">0</int> 
         <array key="object" id="0"/> 
         <reference key="children" ref="1000"/> 
         <nil key="parent"/> 
        </object> 
        <object class="IBObjectRecord"> 
         <int key="objectID">1</int> 
         <reference key="object" ref="191373211"/> 
         <reference key="parent" ref="0"/> 
        </object> 
        <object class="IBObjectRecord"> 
         <int key="objectID">-1</int> 
         <reference key="object" ref="372490531"/> 
         <reference key="parent" ref="0"/> 
         <string key="objectName">File's Owner</string> 
        </object> 
        <object class="IBObjectRecord"> 
         <int key="objectID">-2</int> 
         <reference key="object" ref="975951072"/> 
         <reference key="parent" ref="0"/> 
        </object> 
       </array> 
      </object> 
      <dictionary class="NSMutableDictionary" key="flattenedProperties"> 
       <string key="-1.CustomClassName">ThemesPopOverViewController</string> 
       <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 
       <string key="-2.CustomClassName">UIResponder</string> 
       <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 
       <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 
      </dictionary> 
      <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/> 
      <nil key="activeLocalization"/> 
      <dictionary class="NSMutableDictionary" key="localizations"/> 
      <nil key="sourceID"/> 
      <int key="maxID">3</int> 
     </object> 
     <object class="IBClassDescriber" key="IBDocument.Classes"/> 
     <int key="IBDocument.localizationMode">0</int> 
     <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> 
     <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> 
     <int key="IBDocument.defaultPropertyAccessControl">3</int> 
     <bool key="IBDocument.UseAutolayout">YES</bool> 
     <string key="IBCocoaTouchPluginVersion">2083</string> 
    </data> 
</archive> 

답변

0

어딘가에 일부 이 수행 된 리팩토링 과정에 따라, 오류를 보여 주었다 코드 만 펜촉 이름은 업데이트되지 않았습니다. 따라서 어떻게 든 캐시 된 오래된 코드가 xcode에 사용되었습니다. 그러나 아카이브에서는 이러한 펜촉이 없어 충돌이 발생했습니다. 나는 프로젝트를 청소해야 했어! 더 많은 코드를 살펴 보았습니다!

1
보고 코드는 아래에 첨부

나는 당신이 iOS 배치 타르를 가지고 있다고 생각한다. < 6.0을 얻고 자동 레이아웃을 해제하지 마십시오. View-> Utilites-> Show File Inspector로 이동하여 "Autolayout 사용"옵션의 선택을 해제하십시오. 다른 컴퓨터에서 프로젝트를로드

enter image description here

+0

오류 보고서가 ios 6.1.3에서 왔고 레이아웃이 비어있어 모든 요소를 ​​프로그래밍 방식으로 추가했기 때문에이 경우에는 의심 스럽지만 어쨌든 코드를 변경하면 코드가 변경됩니다. 이제 사과로 돌아갑니다. [귀하의 직감에 대한 자세한 내용] (http://stackoverflow.com/questions/11198981/presentviewcontroller-crash-on-ios-6-autolayout) –