Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void)setupTitleLabel

- (void)setTitle:(NSString *)title
{
_title = [title copy];
_title = title;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我认为,属性中的copy是在自动生成setter时采用copy方式赋值。
手动添加setter时仍然需要手动copy。
所以这里仍然需要 _title = [title copy];

_titleLabel.text = [NSString stringWithFormat:@" %@", title];
if (_titleLabel.hidden) {
_titleLabel.hidden = NO;
Expand Down
12 changes: 6 additions & 6 deletions SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@

#import <UIKit/UIKit.h>

typedef enum {
SDCycleScrollViewPageContolAlimentRight,
typedef NS_ENUM(NSInteger, SDCycleScrollViewPageContolAliment) {
SDCycleScrollViewPageContolAlimentRight = 0,
SDCycleScrollViewPageContolAlimentCenter
} SDCycleScrollViewPageContolAliment;
};

typedef enum {
SDCycleScrollViewPageContolStyleClassic, // 系统自带经典样式
typedef NS_ENUM(NSInteger, SDCycleScrollViewPageContolStyle) {
SDCycleScrollViewPageContolStyleClassic = 0, // 系统自带经典样式
SDCycleScrollViewPageContolStyleAnimated, // 动画效果pagecontrol
SDCycleScrollViewPageContolStyleNone // 不显示pagecontrol
} SDCycleScrollViewPageContolStyle;
};

@class SDCycleScrollView;

Expand Down