2012-03-03 2 views
0

우리는 현재 https 게시 및 응답을 통해 iPhone 응용 프로그램에 "결과"를 전달하고 있습니다. 동일한 16 개의 "자리 표시 자"가있는 반복 구조 문자열입니다. 우리는 현재 일련의 중첩 된 for 루프를 사용하여 목표 C에서이 결과를 처리하고 있습니다. 우리가 함께보고있는iPhone 응용 프로그램에 들어오는 결과를 구문 분석하는 가장 좋은 방법

주요 문제가 : 텍스트의 "모양"사용자 정의

1), 글꼴, 크기 등 대담한 등 표시되는 것은 거의 불가능하다. 2) 중첩 (매우 구체적인 주석을 달아도)은 번거롭고 일부 반복되는 데이터를보고 완전히 지울 수 없었습니다.

우리가 만들고있는 아키텍처를 배치하는 더 좋은 방법이 있습니까? JSON에 대해 많이 읽었습니다. 객관적인 C가 아닌 백엔드에서 테스트해야합니다.

예 반복 STRING : 당신은 확실히 JSON을 살펴해야

*Active Coverage**Health Benefit Plan Coverage**Choice Fund HRA Open Access Plus***********Member is in network based on NPI ID provided in request*Co-Insurance*Individual*Health Benefit Plan Coverage^Acupuncture^Durable Medical Equipment Purchased^Home Health Care^Skilled Nursing Care***.2****In network*****Deductible*Individual*Health Benefit Plan Coverage****1500*****In network******Individual****Remaining*1500*****In network*****Loss)*Individual*Health Benefit Plan Coverage***Year*2500*****In network*****Out of Pocket (Stop Loss)*Individual*Health Benefit Plan*********In network*******Health Benefit Plan Coverage***Lifetime******In network*****Co-Insurance*Family******.2****In network*****Deductible*Family*Health Benefit Plan Coverage***Calendar Year*4500*****In network*****Deductible*Family*Coverage***Remaining*4500*****In network*****Out of Pocket (Stop Loss)*Family*Health Benefit Plan Coverage***Calendar Year*7500*****In network*****Out of Pocket (Stop Loss)*Family*Health Benefit Plan Coverage***Remaining*7500*****In network*****Co-Insurance**Health Benefit Plan Coverage^Acupuncture^Durable Medical Equipment Purchased^Home Health Care^Immunizations^Transplants^Well Baby Care^Skilled Nursing Care*****.4****Out of network*****Deductible*Individual*Health Benefit Plan Coverage***Calendar Year*3000*****Out of network*****Deductible*Individual*Health Benefit Plan Coverage***Remaining*3000*****Out of network*****Out of Pocket (Stop Loss)*Individual*Health Benefit Plan Coverage***Calendar Year*5000*****Out of network*****Out of Pocket (Stop Loss)*Individual*Health Benefit Plan Coverage***Remaining*5000*****Out of network*****Unlimited*Individual*Health Benefit Plan Coverage***Lifetime******Out of network*****Co-Insurance*Family*Health Benefit Plan Coverage*****.4****Out of network*****Deductible*Family*Health Benefit Plan Coverage***Calendar Year*9000*****Out of network*****Deductible*Family*Health Benefit Plan Coverage***Remaining*9000*****Out of network*****Out of Pocket (Stop Loss)*Family*Health Benefit Plan Coverage***Calendar Year*15000*****Out of network*****Out of Pocket (Stop Loss)*Family*Health Benefit Plan Coverage***Remaining*15000*****Out of network*****Limitations*Individual*Acupuncture***Episode***Visits*15**In network*****Limitations*Individual*Acupuncture***Episode***Visits*15**Out of network*****Unlimited*Individual*Durable Medical Equipment Purchased^Skilled Nursing Care***Calendar Year******In network*****Unlimited*Individual*Durable Medical Equipment Purchased^Skilled Nursing Care***Calendar Year******Out of network*****Co-Insurance*Individual*Prosthetic Device*****.2****In network****External Prosthetic Appliances*Deductible*Individual*Prosthetic Device***Calendar Year*0*****In network****External Prosthetic Appliances*Unlimited*Individual*Prosthetic Device***Calendar Year******In network****External Prosthetic Appliances*Co-Insurance*Individual*Prosthetic Device*****.4****Out of network****External Prosthetic Appliances*Deductible*Individual*Prosthetic Device***Calendar Year*0*****Out of network****External Prosthetic Appliances*Unlimited*Individual*Prosthetic Device***Calendar Year******Out of network****External Prosthetic Appliances*Co-Insurance*Individual*Family Planning*****.2****In network****Genetic Testing*Unlimited*Individual*Family Planning***Calendar Year******In network****Genetic Testing*Co-Insurance*Individual*Family Planning*****.4****Out of network****Genetic Testing*Unlimited*Individual*Family Planning***Calendar Year******Out of network****Genetic Testing*Limitations*Individual*Home Health Care***Calendar Year***Days*120**In network*****Limitations*Individual*Home Health Care***Calendar Year***Days*120**Out of network*****Co-Insurance*Individual*Prosthetic Device*****0*Age, High Value*17**In network****Hearing Aid*Co-Insurance*Individual*Prosthetic Device*****0*Age, High Value*17**Out of network****Hearing Aid*Co-Insurance*Individual*Immunizations^Well Baby Care*****0****In network*****Co-Insurance*Individual*MRI Scan*****.2****In network*****Co-Payment*Individual*MRI Scan***Episode*0*****In network*****Deductible*Individual*MRI Scan***Episode*0*****Out of network*****Co-Insurance*Individual*Routine Physical*****0****In network****Adult Preventative Care*Co-Insurance*Individual*Routine Physical*****.4****Out of network****Adult Preventative Care*Co-Insurance*Individual*Rehabilitation*****.2****In network****All Therapies*Unlimited*Individual*Rehabilitation***Calendar Year******In network****All Therapies*Co-Insurance*Individual*Rehabilitation*****.4****Out of network****All Therapies*Unlimited*Individual*Rehabilitation***Calendar Year******Out of network****All Therapies*Co-Insurance*Individual*Consultation*****.2****In network****Specialist Services*Co-Insurance*Individual*Prosthetic Device*****.2****In network****Wig*Limitations*Individual*Prosthetic Device***Years*1000*****In network****Wig*Co-Insurance*Individual*Prosthetic Device*****.2****Out of network****Wig*Limitations*Individual*Prosthetic Device***Years*1000*****Out of network****Wig*Contact Following Entity for Eligibility or Benefit Information*Individual*Pharmacy**Medco************Limitations*Individual*Infertility***Lifetime*15000*****In network****Visits, DX-treatment - incl drugs, IV, GIFT, ZIFT*Limitations*Individual*Infertility***Lifetime*15000*****Out of network****Visits, DX-treatment - incl drugs, IV, GIFT, ZIFT*Active Coverage**Medical Care*************PHS+*Active Coverage**Chiropractic^Hospitalization^Hospital - Inpatient^Hospital - Outpatient^Emergency Services^Professional (Physician) Visit - Office^Urgent Care**************Co-Insurance*Individual*Chiropractic*****.2****In network****Specialist*Limitations*Individual*Chiropractic***Calendar Year***Visits*20**In network****Specialist*Co-Insurance*Individual*Chiropractic*****.2****In network****PCP*Limitations*Individual*Chiropractic***Calendar Year***Visits*20**In network****PCP*Co-Insurance*Individual*Chiropractic*****.4****Out of network****Specialist*Limitations*Individual*Chiropractic***Calendar Year***Visits*20**Out of network****Specialist*Co-Insurance*Individual*Chiropractic*****.4****Out of network****PCP*Limitations*Individual*Chiropractic***Calendar Year***Visits*20**Out of network****PCP*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Specialist services*Coverage Basis*Individual*Hospital - Inpatient^Hospital - Outpatient********In network*In network*****Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****ICU related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****ICU related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Private room related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Private room related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Semi private room related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Semi private room related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Other hospital extras related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****Other hospital extras related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.2****In network****PCP services*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Specialist services*Coverage Basis*Individual*Hospital - Inpatient^Hospital - Outpatient********In network*Out of network*****Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****ICU related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****ICU related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Private room related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Private room related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Semi private room related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Semi private room related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Other hospital extras related to an injury*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****Other hospital extras related to an illness*Co-Insurance*Individual*Hospital - Inpatient*****.4****Out of network****PCP services*Co-Insurance*Individual*Hospital - Outpatient*****.2****In network****Other outpt facility svcs related to an injury*Co-Insurance*Individual*Hospital - Outpatient*****.2****In network****Other outpt facility svcs related to an illness*Co-Insurance*Individual*Hospital - Outpatient^Emergency Services^Urgent Care*****.2****In network****Related to an injury*Co-Insurance*Individual*Hospital - Outpatient^Emergency Services^Urgent Care*****.2****In network****Related to an illness*Co-Insurance*Individual*Hospital - Outpatient*****.4****Out of network****Other outpt facility svcs related to an injury*Co-Insurance*Individual*Hospital - Outpatient*****.4****Out of network****Other outpt facility svcs related to an illness*Co-Insurance*Individual*Hospital - Outpatient*****.4****Out of network****Related to an injury*Co-Insurance*Individual*Hospital - Outpatient*****.4****Out of network****Related to an illness*Co-Insurance*Individual*Emergency Services^Professional (Physician) Visit - Office*****.2****In network****PCP related to an injury*Co-Insurance*Individual*Emergency Services^Professional (Physician) Visit - Office*****.2****In network****PCP related to an illness*Co-Insurance*Individual*Emergency Services*****.2****In network****Professional services related to an injury*Co-Insurance*Individual*Emergency Services*****.2****In network****Professional services related to an illness*Co-Insurance*Individual*Emergency Services^Professional (Physician) Visit - Office*****.4****Out of network****PCP related to an injury*Co-Insurance*Individual*Emergency Services^Professional (Physician) Visit - Office*****.4****Out of network****PCP related to an illness*Co-Insurance*Individual*Emergency Services*****.4****Out of network****Professional services related to an injury*Co-Insurance*Individual*Emergency Services*****.4****Out of network****Professional services related to an illness*Co-Insurance*Individual*Emergency Services^Urgent Care*****.2****Out of network****Related to an illness*Deductible*Individual*Emergency Services***Calendar Year*1500*****Out of network****Related to an illness*Deductible*Family*Emergency Services***Calendar Year*4500*****Out of network****Related to an illness*Out of Pocket (Stop Loss)*Individual*Emergency Services***Calendar Year*2500*****Out of network****Related to an illness*Co-Insurance*Individual*Emergency Services^Urgent Care*****.2****Out of network****Related to an injury*Deductible*Individual*Emergency Services***Calendar Year*1500*****Out of network****Related to an injury*Deductible*Family*Emergency Services***Calendar Year*4500*****Out of network****Related to an injury*Out of Pocket (Stop Loss)*Individual*Emergency Services***Calendar Year*2500*****Out of network****Related to an injury*Co-Insurance*Individual*Professional (Physician) Visit - Office*****.2****In network****OBGYN*Co-Insurance*Individual*Professional (Physician) Visit - Office*****.2****In network****Specialist related to an injury*Co-Insurance*Individual*Professional (Physician) Visit - Office*****.2****In network****Specialist related to an illness*Co-Insurance*Individual*Professional (Physician) Visit - Office*****.4****Out of network****OBGYN*Co-Insurance*Individual*Professional (Physician) Visit - Office*****.4****Out of network****Specialist related to an injury*Co-Insurance*Individual*Professional (Physician) Visit - Office*****.4****Out of network****Specialist related to an illness*Deductible*Individual*Urgent Care***Calendar Year*1500*****Out of network*****Deductible*Family*Urgent Care***Calendar Year*4500*****Out of network*****Out of Pocket (Stop Loss)*Individual*Urgent Care***Calendar Year*2500*****Out of network*****Active Coverage**Health Benefit Plan Coverage**CareLink************Active Coverage**Mental Health**Open Access Plus************Limitations*Individual*Health Benefit Plan Coverage***Remaining*751*********HRA BALANCE
+1

"예제 텍스트"가 엉망이며 도움이되지 않습니다. 형식에 대한 설명을 입력하십시오 (예 : ' * '또는 무엇인가). 그러면 목표는 무엇입니까? 빠른 파싱? 조각으로 나눠서? 당신은 정말로 말하지 않았습니다. 마지막으로, 이것은 통제 할 수있는 서비스에서 오는 것입니까? 즉, 형식이 고정되어 있거나 영향을 줄 수 있습니까? – DarkDust

+0

죄송합니다. 예, 반복적 인 구조입니다. variable1 * variable2 * variable3 * variable4 * (15 개의 플레이스 홀더가 있으며 반복됩니다) –

+0

목표 : 신속한 구문 분석, 조각 나누기, 출력 스타일 지정 가능. –

답변

1

. http://en.m.wikipedia.org/wiki/JSON 데이터 소스를 제어 할 수없는 경우 소스와 앱 사이에 추가 레이어를 만들 수 있습니다. 이 레이어에서이 데이터를 JSON으로 변환 할 수 있습니다.

+0

원본 데이터를 JSON 인앱으로 변환해야하는 시점은 무엇입니까? 추가 오버 헤드가 발생하고 있습니다. – DarkDust

+0

앱에 없습니다. 웹 서비스에서이 작업을 수행 할 수 있습니다. 그런 다음 장치로 전송할 데이터가 훨씬 적습니다. – FrediWeber

+1

나는 그것을 얻지 않는다. 당신은 웹 서비스 A의 출력을 파싱하고 webservice B로 변환하여 응용 프로그램 C가 파싱 할 수있게하고 싶습니까? 복잡성, 대기 시간 및 장애 지점을 추가 할 수 있습니다. – DarkDust

관련 문제