거의 몇 년 동안 하루에 한 번 이상은 보는 테이블 뷰

 

#pragma mark -

#pragma mark TableView Delegate



if (YES == [mDfct.mode isEqualToString:@"U"] && (YES ==[mDfct.cd_hndl_stat isEqualToString:@"E"] || YES ==[mDfct.cd_hndl_stat isEqualToString:@"X"]))




- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

 

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

 

지겹다…




sqliteFlow 에서는 제대로 나오는 쿼리가

 

SELECT

    cd_tppg

  , id_loc

  , id_uper_loc

  , nm_loc

FROM ddtbt_site_tppg_loc

WHERE cd_tppg = '70A_J'

ORDER BY

    oder_mkar

  , nm_loc;



갑자기 화면에서 나오지 않는다. 서버에서 뭐가 바뀌었다고 한다 ㅡㅡ;

 

 while(sqlite3_step(compiledStatement) == SQLITE_ROW) {

                DDTBT_SITE_TPPG_LOC *data = [[DDTBT_SITE_TPPG_LOC alloc] init];

                data.cd_tppg = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];

                data.id_loc = sqlite3_column_int(compiledStatement, 1);

                data.id_uper_loc = sqlite3_column_int(compiledStatement, 2);

                data.nm_loc = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];

                [array addObject:data];

            }

 

hmm.. 별 문제 없어 보이는데… BP 찍어보니 sql 에서 채워졌어야 할 data array 에 element가 0이다.




@interface QualityControl2 : BaseViewController<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate, UIActionSheetDelegate, UIImagePickerControllerDelegate, BaseViewDelegate, MTSpeechRecognizerDelegate> {

    MTSpeechRecognizerClient *speechRecognizerClient;

    

    UITableView *mTableViewLoc;

    NSMutableArray *mListLoc;

 

    @property (nonatomic, strong) NSMutableArray *mListLoc;



    @synthesize mListLoc;



잘 되던 코드가 안되니 프로퍼티로 바꾸어 보았다.

 

똑같다.

 

웃긴 건





  array = [[NSMutableArray alloc] init];



가 들어가면...

 

2021-05-20 10:01:32.937461+0900 MBASS[18252:4236337] 810707 result 70A_J 12442 13 현관1 count: 1

2021-05-20 10:01:32.937579+0900 MBASS[18252:4236337] 810707 result 70A_J 10 9 공용욕실1 count: 2

2021-05-20 10:01:32.937671+0900 MBASS[18252:4236337] 810707 result 70A_J 3 1 침실1 count: 3

2021-05-20 10:01:32.937763+0900 MBASS[18252:4236337] 810707 result 70A_J 4 1 침실2 count: 4

2021-05-20 10:01:32.937848+0900 MBASS[18252:4236337] 810707 result 70A_J 5 1 침실3 count: 5

2021-05-20 10:01:32.937934+0900 MBASS[18252:4236337] 810707 result 70A_J 12967 12 거실1 count: 6

2021-05-20 10:01:32.938029+0900 MBASS[18252:4236337] 810707 result 70A_J 6 2 발코니1 count: 7

2021-05-20 10:01:32.938109+0900 MBASS[18252:4236337] 810707 result 70A_J 12533 19 주방/식당 count: 8

2021-05-20 10:01:32.938193+0900 MBASS[18252:4236337] 810707 result 70A_J 12523 31 다용도실 count: 9

2021-05-20 10:01:32.938277+0900 MBASS[18252:4236337] 810707 result 70A_J 8022 26 드레스룸 count: 10

2021-05-20 10:01:32.938363+0900 MBASS[18252:4236337] 810707 result 70A_J 102 14 부부욕실1 count: 11

2021-05-20 10:01:32.938444+0900 MBASS[18252:4236337] 810707 result 70A_J 15638 29 대피공간1 count: 12

2021-05-20 10:01:32.938627+0900 MBASS[18252:4236337] 810707 result 70A_J 13352 30 실외기실1 count: 13



들어간 array에 카운트가 나온다.

 

빼면...

 

2021-05-20 10:02:46.587067+0900 MBASS[18257:4237001] 810707 result 70A_J 12442 13 현관1 count: 0

2021-05-20 10:02:46.587261+0900 MBASS[18257:4237001] 810707 result 70A_J 10 9 공용욕실1 count: 0

2021-05-20 10:02:46.587414+0900 MBASS[18257:4237001] 810707 result 70A_J 3 1 침실1 count: 0

2021-05-20 10:02:46.587556+0900 MBASS[18257:4237001] 810707 result 70A_J 4 1 침실2 count: 0

2021-05-20 10:02:46.587706+0900 MBASS[18257:4237001] 810707 result 70A_J 5 1 침실3 count: 0

2021-05-20 10:02:46.587851+0900 MBASS[18257:4237001] 810707 result 70A_J 12967 12 거실1 count: 0

2021-05-20 10:02:46.587988+0900 MBASS[18257:4237001] 810707 result 70A_J 6 2 발코니1 count: 0

2021-05-20 10:02:46.588170+0900 MBASS[18257:4237001] 810707 result 70A_J 12533 19 주방/식당 count: 0

2021-05-20 10:02:46.588313+0900 MBASS[18257:4237001] 810707 result 70A_J 12523 31 다용도실 count: 0

2021-05-20 10:02:46.588482+0900 MBASS[18257:4237001] 810707 result 70A_J 8022 26 드레스룸 count: 0

2021-05-20 10:02:46.588620+0900 MBASS[18257:4237001] 810707 result 70A_J 102 14 부부욕실1 count: 0

2021-05-20 10:02:46.588790+0900 MBASS[18257:4237001] 810707 result 70A_J 15638 29 대피공간1 count: 0

2021-05-20 10:02:46.588934+0900 MBASS[18257:4237001] 810707 result 70A_J 13352 30 실외기실1 count: 0



안나온다.

 

            [array addObject:data];

가 안되는 것이다.

 

신기한 것은 지금까지 잘 되던 코드인데 갑자기 안된다는 것.



- (NSMutableArray*) RETNselectSiteTppgLoc:(NSMutableArray *)array withTppgCd:(NSString *)tppgCd {

 

포인트 파라미터 방식을 리턴 방식으로 바꾸어서 해결…



에혀… 참 별의 별개 갑자기 안된다.

 

빨리 Swift 세상이 되길…


'Objective-C, SQLite3' 카테고리의 다른 글

iOS Photokit  (0) 2021.05.26
ViewController 자료 교환 방식 수정  (0) 2021.05.20
ImageButton  (0) 2021.05.18
List  (0) 2021.05.18
UIViewController 중첩  (0) 2021.05.18

+ Recent posts