Tôi có rất nhiều sự nhầm lẫn về API Định dạng Clang.Làm thế nào để cấu hình Clang Format cho Allman style for iOS coding?
- Tôi không thể mở tệp .clangformat để tôi có thể xem xét và định cấu hình theo tôi.
- Tôi cần phải định dạng mã của mình theo kiểu Allman.
- Tôi cũng đã thấy rất nhiều tài liệu về Google và Stack Overflow nhưng tôi không nhận được bất kỳ trợ giúp nào để đạt được định dạng kiểu Allman.
Tôi đã xem qua số http://clangformat.com/ nhưng tôi cũng không nhận được bất kỳ trợ giúp nào để đạt được phong cách Allman.
Đây là vấn đề và giải pháp tôi muốn.
Issue # 1:
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(captureSearchFiltersNotificationWithSelection:)
name:kSearchFiltersNotificationWithSelection
object:nil];
CẦN # 1:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(captureSearchFiltersNotificationWithSelection:)name:kSearchFiltersNotificationWithSelection object:nil];
Issue # 2:
- (id)initWithNibName:(NSString *)nibNameOrNil
bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// listings = [NSMutableArray new];
self.navTitle = @"Buy";
searchFilters = [SearchFilter new];
if ([LocationManager locationManager].location == nil) {
selectedSortOption = kSortBuyRefineOptionUndefined;
}
else {
selectedSortOption = kSortBuyRefineOptionNearMeAsc;
}
}
return self;
}
CẦN # 2:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
listings = [NSMutableArray new];
self.navTitle = @"Buy";
searchFilters = [SearchFilter new];
if ([LocationManager locationManager].location == nil)
{
selectedSortOption = kSortBuyRefineOptionUndefined;
}
else
{
selectedSortOption = kSortBuyRefineOptionNearMeAsc;
}
}
return self;
}
@halfer Bất kỳ ý tưởng nào về câu trả lời? – Developer
Re: "Tôi không thể mở tập tin .clangformat để tôi có thể xem xét và cấu hình theo tôi.", Bạn có thể làm rõ ý bạn là gì, vì nó không rõ ràng? Tên tệp thường phải là '.clang-format' hoặc' _clang-format' và được đặt trong thư mục dự án. –
@ l'L'l Trong trình chỉnh sửa nào, tôi có thể xem nội dung của tệp ".clang-format"? – Developer