본문 바로가기

프로그램 경험

[VC++] MAC 주소 가져오기 #include // for GetAdaptersInfo() #pragma comment(lib, "iphlpapi.lib" ) CString CLogin::GetMACAddress() { CString strMac; DWORD size = sizeof(PIP_ADAPTER_INFO); PIP_ADAPTER_INFO Info; ZeroMemory( &Info, size ); int result = GetAdaptersInfo( Info, &size ); // 첫번째 랜카드 MAC address 가져오기 if (result == ERROR_BUFFER_OVERFLOW) // GetAdaptersInfo가 메모리가 부족하면 재 할당하고 재호출 { Info = (PIP_ADAPTER_INFO)malloc(si..
[iPhone] UITableViewCell에 높이 조절하기 테이블 셀의 높이가 각각 다른 테이블을 만드는중 문제가 생겼다. 테이블 셀의 뷰를 놓고 그 위에 텍스트 박스를 놓았는데 텍스트 내용의 길이에 따라서 높낮이를 조절해야 한다. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if ([indexPath row] == 0) { return 100; } return 80; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellId = @"cellId "; CellId..
[iPhone] UIImageView에 테두리 넣기 #import "QuartzCore/QuartzCore.h" [imgView.layer setBorderColor: [[UIColor blackColor] CGColor]]; [imgView.layer setBorderWidth: 1.0];
[iPhone] 그룹 설정된 테이블뷰 바탕색상 변경하기 UITableView *table = (UITableView *) [self.view viewWithTag:2]; UIView *backgroundView = [[UIView alloc] initWithFrame: table.frame]; backgroundView.backgroundColor = [UIColor whiteColor]; table.backgroundView = backgroundView; [backgroundView release];
APE파일을 MP3파일로 변환하기 압축풀고 사용하면 된다.
[iPhone] 클래스명으로 객체 생성하기 예제 소스를 보다가 괜찮은 팁이 있어서 복사 했다. 클래스명으로 객체를 생성하는 팁이다. Class cls = NSClassFromString(@"UIPopoverController"); if (cls != nil) { UIPopoverController *aPopoverController = [[cls alloc] initWithContentViewController:self.masterViewController]; self.popoverController = aPopoverController; [aPopoverController release]; [popoverController presentPopoverFromBarButtonItem:barButtonItem permittedArrowDirectio..
[VC++] CMap 사용법 CMap *map; map->SetAt(_T("230.10"), _T("300")); map->SetAt(_T("230.15"), _T("305")); (*map)[_T("230.20")] = _T("310"); CString s = (*map)[_T("230.20")]; delete map;
[iPhone] Command ... gcc-4.2 failed with exit code 1 잘되던 프로젝트가 빌드하니까 오류 메시지를 뱉어 냈다. 해결책은... 모르겠다. ㅠㅠ 시뮬레이터에서 빌드 하면 오류가 나고 디바이스 연결해서 빌드하면 문제가 사라진다.