Segment widget provides multiple way to set the data. Sometimes a wrong usage of API’s can lead to application performance degrade.
Use setData:
- When you want to set Initial data to segment.
- When you want to change complete data to segment.
- When you want to change multiple rows in segment.
Use setDataAt:
- When you want to modify a single row on a particular user action.
Note: use any index based API’s per user action. and do not use any index based API’s inside for loop.